Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
How do I get an slider (took from here, the Ace Slider) to only be drawn on it's sprite? — Gideros Forum

How do I get an slider (took from here, the Ace Slider) to only be drawn on it's sprite?

Ozkar619Ozkar619 Member
edited October 2012 in General questions
Hi, I'm having this small issue.
When changing from one scene to another, if the slider is bigger than one screen, then it shows it's content over the other scene before the transition ends. I'm not sure if i'm explaining myself correctly here's a little video:

What I'm trying to do it's like a css overflow:hidden. I want the objects to stay within the limits of the sprite.

I've set a size to the sprite, but I'm not sure if it is static or it changes when I add more objects (wich is the most probable case).

Any Ideas?

Thanks in advance!

Oscar Obeso.

Comments

  • ar2rsawseenar2rsawseen Maintainer
    edited October 2012 Accepted Answer
    Hi @Ozkar619 cool design by the way.

    I would say, that you are probably adding slider on scene:init. But what you could do is try to listen to SceneManager events and add slider on transition "enterEnd" event.

    So basically:
    scene = gideros.class(Sprite)
     
    function scene:init()
        --add on enterEnd event
        self:addEventListener("enterEnd", self.onEnterEnd, self)
    end
     
    --enter end event
    function level:onEnterEnd() 
        --add slider here
    end
    But about achieving overflow:hidden effect, I don't know if it's possible, because sprite has no dimensions and expands as much as there are contents of it's children.
    Something like that could be done using Shape and fill it with texture, but not the Sprite objects.


    But I don't think you have to worry about that so much, it took me couple of times (~5) to closely watch your video and finally spot the thing you were talking about :)

    Likes: Ozkar619

    +1 -1 (+1 / -0 )Share on Facebook
  • Yeah, you were right about the onEnterEnd method, I don't know why I didn't see it before D: I must need some rest, hmmm nah maybe more coffe.. Thank you very much :)!

    Oh and my exact reaction:
    Hi @Ozkar619 cool design by the way.
    me:
    image

    Cheers! :D

    Likes: Ozkar619

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.