Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Director + touch event #29

Closed
Driox opened this issue Mar 20, 2012 · 6 comments
Closed

Director + touch event #29

Driox opened this issue Mar 20, 2012 · 6 comments
Assignees
Labels

Comments

@Driox
Copy link

Driox commented Mar 20, 2012

case :

  • a director switch 2 scenes with clic on buttons (one button per scene)
  • buttons have listeners like btn:setOnTouchDown(handler)
  • the listener doesn't work on the 2nd scene

I'm quite new to rapanui so i'm just guessing where the problem is :

  • director creates new scene in RNScreen, self.sprites grows up
  • then director destroy the first view, RNScreen:removeRNObject is called and self.sprites reduces HOWEVER rnObjectId isn't change
  • when RNScreen:getRNObjectWithHighestLevelOn is called, the button is never find because rnObjectId > ||self.sprites||

possible solution : add self.sprites[k]:getProp().rnObjectId = k - 1 in RNScreen, at line 93. I didn't test potential side effects

@eljeko
Copy link
Collaborator

eljeko commented Mar 20, 2012

Hi Driox,

Do you mind to put your code online so we can replicate and test?

thanks in advance!

@Driox
Copy link
Author

Driox commented Mar 21, 2012

Hi Stefano,

Here is the test case. I comment the potential fix in RNScreen, at line 93.

Regards,

Adrien

Message du 20/03/12 23:10
De : "Stefano Linguerri"
A : "Driox"
Copie à :
Objet : Re: [rapanui] Director + touch event (#29)

Hi Driox,

Do you mind to put your code online so we can replicate and test?

thanks in advance!


Reply to this email directly or view it on GitHub:
#29 (comment)

@eljeko
Copy link
Collaborator

eljeko commented Mar 22, 2012

Hi,

No link found in comment, by "Here is the test case" do you mean the opening case comment?

thank you,
Stefano

@ghost ghost assigned eljeko Mar 22, 2012
@Driox
Copy link
Author

Driox commented Mar 22, 2012

Sry, I just answer the email from github and join a file

here a real link : https://rapidshare.com/files/872225331/test.zip?bin=1

@eljeko
Copy link
Collaborator

eljeko commented Mar 27, 2012

Hi we are busy on updating RapaNui to new MOAI.

After the update we go on on this.

sorry for delay

@MattiaFortunati
Copy link
Collaborator

Hey, you can chek
https://github.com/ymobe/rapanui/blob/rapanuidev/rapanui-samples/menu/rn-menu-director.lua
this will explain how to use director and buttons.

I'll close the issue once this will be on Master branch.

Have Fun,

Mattia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants