orx object enable/disable

edited May 2013 in Help request
Maybe I'm not looking in the right places, but I cannot find a way to enable/disable orx objects. By enable/disable I mean that I don't want graphics shown, events received, clocks updated, without destroying the object.

Comments

  • edited May 2013
    orxObject_Enable() should be pretty much what you're looking for.
  • edited May 2013
    ah, that's where it was! much appreciated
  • jimjim
    edited October 2013
    Is their any object event handler when I disable/enable an object like orxOBJECT_EVENT_ENABLE/orxOBJECT_EVENT_DISABLE, they are quite handy actually.
  • edited October 2013
    Ah nope, it's not there but I can add it.
    Generally I tend to add events to notify when something is done by orx itself and there's no code path that would lead to orx enable/disable an object on its own, those have to be triggered by the user.

    For which scenario would you need it?
  • jimjim
    edited October 2013
    Oh, like I have 10 enemy on screen, when player kills them, they could simple disable themselves and could done some necessary cleaning stuffs, when they are enabled they could set some variables at random like their life,anger,speed etc.

    Or I can create my enemies first, and put them to sleep, then at random interval I would enable them. They would do then necessary stuffs on themselves.
    But this could also be done using other techniques, an enemy manager could do this sort of stuffs though, as their is event for object create and delete, enable/disable can also be an event.
  • edited October 2013
    Well in the case of creation and deletion, those can be done by orx without any direct user action (spawners, lifetime, ...), which is not the case of enabling/disabling.
    That being said I don't have any problem with adding those events. :)
  • jimjim
    edited October 2013
    If it is not too much of a work, or an issue can be created to add this functionality later.
  • edited October 2013
    Done! :)
  • jimjim
    edited October 2013
    Wow, that's too quick, thanks :)
  • edited October 2013
    My pleasure, that was an easy one. ;)
Sign In or Register to comment.