@tytadas I have some question to you: 1-Did you define your sceneclasses and are you sure there are really exist correspending lua files for the scenes with the same names(you should have PlayScene.lua,sc1.lua and sc2.lua for the below example) :
I'm sorry, but I'm going to add the file codes because I already imported a lot of game stuff and images, so I would like to keep everything in a secret
And inside playScene.lua theres nothing else but just a black background. It seems I added everything to know about the project. I tried adding EnterEnd listener, but still doesn't seem to work.
Lua files are not always processed in order. Maybe your configuration.lua file is executed after you need it. So can you add all your configration file code to init.lua. init.lua is some special file which Gideros will always execute first. Even before main.lua.
Best way is to download some working Scenemanager project or create so much simple one by your self without any details (no conf file, no extra code )as i wrote before. So you can be sure if there is some problem with your code, structure etc etc.... If it will also not work we can focus on the correct side of the problem. Now we are just wildly guessing
The most interesting part is that I widely checked mines project code dependency and the GameTemplate code dependency. There aren't any big difference or should I say the call order is the same as GameTemplate.
GameTemplate code dependency: This is from the bottom to the top: main.lua start.lua and scenes(pack_select.lua and etc...) later it goes conf.lua and after that all the classes( dataSaver, scenemanager..)
So the call order is the same type as the GameTemplate. I checked the call order already for like 150 times, It can't be true that I'm missing something, ofcourse it's possible but I'm a human as everyone else. Sorry for your time
So it seems there is something wrong in your PlayScene. Maybe just make a new project and copy that scene into it. Then in main just create a new instance of the PlayScene and see if Gideros Studio throws an error.
@talis Hey man, You have changed my code so the button would manage the game to move to another scene. But every button now reacts to the same changeScene code, I have 4 buttons, and all the 4 buttons changes me to the "play" scene and it shouldn't be like that.. What to do??
yes, it works. But imagine you have 4 different buttons, and all the buttons,while being pressed and the scene changes right? And my codes on different buttons has different change scene name:
which would work if there is only one such button in the scene, because if you have more than one, you need to check that click coordinates are within your button bounds. That is :
Or something similar. If my assumptions are correct and doing this fixes your issue, I'll leave it to as an exercise to explain to others why you had such a behaviour without that check :P
Comments
Here's the code to move to another scene
1-Did you define your sceneclasses and are you sure there are really exist correspending lua files for the scenes with the same names(you should have PlayScene.lua,sc1.lua and sc2.lua for the below example) :
http://appcodingeasy.com/Gideros-Mobile/Manage-Scenes-in-Gideros-Mobile
Please let us know if you solve your issue.
In addition can you try this one:
https://github.com/ar2rsawseen/GameTemplate
This is gameTemplate it also uses scene manager and it is working. So we can be sure if the problem is with your code or not.
firstScene.lua file
It seems I added everything to know about the project. I tried adding EnterEnd listener, but still doesn't seem to work.
Likes: antix
So can you add all your configration file code to init.lua.
init.lua is some special file which Gideros will always execute first. Even before main.lua.
Best way is to download some working Scenemanager project or create so much simple one by your self without any details (no conf file, no extra code )as i wrote before. So you can be sure if there is some problem with your code, structure etc etc....
If it will also not work we can focus on the correct side of the problem. Now we are just wildly guessing
GameTemplate code dependency:
This is from the bottom to the top:
main.lua
start.lua
and scenes(pack_select.lua and etc...)
later it goes conf.lua
and after that all the classes( dataSaver, scenemanager..)
Mine code dependency:
main.lua
firstScene.lua
2 splashscreen scenes
configuration.lua
and classes
So the call order is the same type as the GameTemplate. I checked the call order already for like 150 times, It can't be true that I'm missing something, ofcourse it's possible but I'm a human as everyone else. Sorry for your time
main.lua:
Try like this please:
main.lua
Likes: tytadas
Likes: tytadas
Output:
Can you try using the button class from here:
https://github.com/gideros/Button/blob/master/button.lua
I think @hgy29 assumptions is correct and Button Class will help you with hitTestPoint error above.
Likes: vitalitymobile