Hi, i'm following the instructions of
@ar2rsawseen on ACE and got a little problem:
1 - Game Home screen = Share Button are showing
2 - GamePlay screen = Share Button off, that's ok
3 - Game Score screen = Share Button off
4 - Game Home screen = Share Button off
How to show this Button on screens/scenes that i need ? Like Score screen and Home screen (when i get back).
Because when i get back to Home, the button just disappear;
http://appcodingeasy.com/Gideros-Mobile/Share-button-in-Gideros-appThanks;
Comments
will need to see more code
do you use SceneManager?
do you create and add share button in each scene?
-Add your share button to stage in the beginning.(Main menu)
-Remove it where you do not want it on the on enter scene event.
-Add it again where you want it.(On enter scene again)
So by default your button will be there for the mainmenu. Than you will remove or add for your needs.
@talis add function and remove function on every screen ? (Home/Score)
Here some screen shots - Before i copy/paste code let me know where i do that
Cause this code got copyright from @H4ch1 and i don't want to pass a little
vacation on jail
Home Screen
http://www.m5gt.com/ComplexC-1-HomeScreen.jpg
Game Play Screen
http://www.m5gt.com/ComplexC-2-GamePlayScreen.jpg
Score Screen
http://www.m5gt.com/ComplexC-3-ScoreScreen.jpg
main.lua
http://www.m5gt.com/ComplexC-4-GiderosS-Main.jpg
mainScreen.lua
http://www.m5gt.com/ComplexC-5-GiderosS-MainScreen.jpg
endingScreen.lua
http://www.m5gt.com/ComplexC-6-GiderosS-EndingScreen.jpg
scoreModule.lua
http://www.m5gt.com/ComplexC-7-GiderosS-ScoreModule.jpg
Thank you for your attention;
http://www.karnakgames.com/wp/gideros-svg-level-builder/
when method delete is used, every object is removed from stage, thus also removing Share button.
To fix that you'll need to add Share button not inside main.lua, but inside mainScreen.lua in GCmainScreen:init method, so each time you'll got to mainScreen Share button would be created from scratch
Likes: KeepTrying
@H4ch1 comments
self:addChild(bg); --self relate to the GCmainScreen instance. You must add everything to this class if you want it to be displayed
A little modification based on comment
--add holder to stage
stage:addChild(holder)
Changed to:
--add holder to stage
self:addChild(holder)
Where is and what is that "self" person i don't know
Coding: challenging and fun;
Next step: AdMob by ACE
http://www.karnakgames.com/wp/gideros-svg-level-builder/
In your case, if you are inside GCmainScreen instance, then self is referenced to GCmainScreen instance
If you'll need any help on Admob feel free to ask. I think tutorial was for a little older Gideros version, so the code of main Java class has changed a bit, but if you follow same steps and apply only modifications described, you'll be ok
Likes: KeepTrying
http://www.karnakgames.com/wp/gideros-svg-level-builder/
I think the layer of the buttons are not being recognized; o_O
Layer 0 (backLayer) = playButton/restartButton
Layer 1 (frontLayer) = shareButton
HomeScreen = playButton + shareButton
ScoreScreen = restartButton + shareButton
On ScoreScreen the entire screen is being treated as the restart button.
On HomeScreen the behavior is normal, but the open command browser is not firing;
Android 2.3.3 + 3.2 = 100% Ok
http://www.karnakgames.com/wp/gideros-svg-level-builder/
How it works in Gideros desktop player and Gideros IOS player?
Basically sounds something like e:stopProgatation() is not used where it should be, but I can't tell more without examining the code.
You might want to contact code owner for this one.
Gideros IOS player = the same problem
@ar2rsawseen i'll test this stopProgatation() thing;
By the way you are member of Gideros Dev Team ?
http://www.karnakgames.com/wp/gideros-svg-level-builder/
@Arthurs has been the guiding light for many new developers that come to Gideros. It is commendable effort indeed.
Likes: KeepTrying, gorkem
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
http://www.karnakgames.com/wp/gideros-svg-level-builder/
Likes: KeepTrying