Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Using Widget Candy with SceneManager — Gideros Forum

Using Widget Candy with SceneManager

bravcmbravcm Member
edited December 2013 in General questions
Hi,

I've already bought Widget Candy library and now I'm wondering how to use library controls with SceneManager class. Because Windget Candy uses _G.GUI.Stage for base surface which is in conflict with SceneManager. Any hint or sample how to use ex. simple button from Widget Candy with SceneManager will be very helpful.

Thank you!

Comments

  • talistalis Guru
    edited December 2013 Accepted Answer
    In this hint from their official site it seems easy but need to try maybe it is not as seems:D :
    http://www.x-pressive.com/WidgetCandy_Corona/tutorials.html#Hints3

    **********************************************************************************
    When using a scene manager, keep the two rules in mind:
    First create a scene, THEN create your widgets.
    First remove your widgets, THEN switch to another scene.
    You should never remove widgets manually using Corona's :removeSelf() or Gideros' :removeFromParent() methods. Use the widget's :destroy() method instead and let Widget Candy do this for you. This is because there is data associated with the widgets that also needs to be removed. When you remove your widgets manually (or if a scene manager tries to remove them) this data remains in memory and cannot be removed anymore.
    ******************************************************************************************
  • Yes, that all true, but nothing appear on the stage! Seems like scene manager and Widget Candy uses different stage!?
  • Most probably you could also use exitBegin event to destroy widgets.

    And in scene, you add everything to the scene, but widget candy seems to be adding everything to the stage, meaning that, you should only create widgets after you created the scene, so it would be added to the stage after the scene and be on top of that.
    enterEnd event suits that perfectly ;)

    Likes: bravcm

    +1 -1 (+1 / -0 )Share on Facebook
  • Yes, ar2rsawseen you are right. Especially must define parentGroup which is scene (self). Everything now works like a charm! I'm Happy!! :)
  • bravcm, Widgets can be added to any parent, using the .parentGroup property. Specify either a window name or a sprite handle to put the widget into that parent.

Sign In or Register to comment.