Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - sicbe

Pages: [1]
1
Support / Re: Using tk2dButton Events
« on: May 04, 2012, 02:57:59 pm »
Yes I just noticed that the version downloaded from the asset store is different so I downloaded the 1.7 final here on the forum and now it works... :).

2
Support / Re: Using tk2dButton Events
« on: May 04, 2012, 01:43:25 pm »
Alright... Thanks :). That makes sense... Tried it and it works...

But it only works for ButtonAutofireEvent, ButtonPressedEvent and ButtonUpEvent... I can't get the ButtonDownEvent to work like in your example...

I tried:
button.ButtonDownEvent += Down;
button.ButtonUpEvent += Up;

with just logging "up" and "down" in the functions... I only get "up" logs in my console and no "down" logs...

Strange?

3
Support / Using tk2dButton Events
« on: May 04, 2012, 10:44:23 am »
Hello,

I've been trying all day to figure out how to use the button delegates...

I have created four tk2dButtons that I want to use as "controls" for the player.

Two buttons for moving left and right... They should keep a variable "moveLeft" or "moveRight" (in my movementController) at true when pressed  and revert the value to false when they are released.

Two other buttons for jump and attack... They should fire only once when pressed down. So when pressed down they should turn a variable "jump" or "attack" (in my movementController) to true (which is automatically turned to false at the end of the frame)...

How do I go about creating this using tk2dButtons? Is it even possible? Also I'm using Javascript and the reference is rather unclear about this... :-).

Thanks...

Pages: [1]