Page 1 of 1

Problem

PostPosted: Thu Mar 29, 2012 11:34 am
by NightOfHorror
I have a canvas over all my actors in a sub-game I am working on to make it disable all events. Then there is a canvas over the actors that when you click on them they disable the canvas, but disable some events and enable some. When I click on one of the actors, I am supposed to be able to move left and right or up and down depending on which one it is. Unluckily, all events are still disabled. Sorry, I just never learned much on canvas.

Re: Problem

PostPosted: Thu Mar 29, 2012 1:58 pm
by SuperSonic
I'm not exactly sure what you are trying to accomplish. It sounds like you're wanting to change players by clicking on them? Could you upload your ged maybe? :D

Also, it's not a good idea to use DisableEvents(). Try using if statements and variables instead. For example:

global code
Code: Select all
int Player1CanMove;


Player1 key down -> right:
Code: Select all
if(Player1CanMove)
{
    x += 1;
}

Re: Problem

PostPosted: Thu Mar 29, 2012 5:59 pm
by skydereign
Using EventDisable isn't a bad thing to do, as long as you keep it simple. It works just like you would if you were destroying and creating the different players, without actually disabling them. But it sounds like what you are doing with canvas is completely nonsensical. First of all, why canvas? It sounds like you should just be using a filled region for this. But, if you want to be able to click an actor after it has been disabled, you need to either enable it from another actor's event, or to enable mouse button down event after disabling all events. But I would recommend doing from another actor.

Re: Problem

PostPosted: Fri Mar 30, 2012 1:11 pm
by NightOfHorror
I found out my mistake. It was simple really, the BIgCanvas well disabled all events on every actor, so it disabled the MouseDown event. uhm, well, I guess all I can say is thank you for advise. I am a noob. :lol:

Re: Problem

PostPosted: Fri Mar 30, 2012 2:12 pm
by SuperSonic
NightOfHorror wrote:uhm, well, I guess all I can say is thank you for advise. I am a noob. :lol:

Hey, even a programming God can make mistakes too haha ^^

Re: Problem

PostPosted: Fri Mar 30, 2012 9:43 pm
by NightOfHorror
well, in that case, sky, gogo, mak, and akr, what mistakes do you do?

Re: Problem

PostPosted: Mon Apr 02, 2012 1:07 pm
by Game A Gogo
Typos, sometimes in C++ I forget to have a corresponding delete for a new function, which causes memory leaks :P

Re: Problem

PostPosted: Mon Apr 02, 2012 4:29 pm
by Hblade
I deleted the post that someone placed a warning on.

Re: Problem

PostPosted: Mon Apr 02, 2012 6:25 pm
by Game A Gogo
Thanks, that was me... It looked suspicious S:

Re: Problem

PostPosted: Mon Apr 02, 2012 7:19 pm
by Hblade
That user looks suspicious, he posted another seemingly useless post, acting as if the post was directed to --him-- he said "Thanks for sharing this post with......... me..."

-__-