android
  #1  
Old 05-21-2011, 05:25 AM
TexMex TexMex is offline
Junior Member
 
Join Date: May 2011
Posts: 20
Help Hey I'm not very familiar with lua and wonder if anyone can help me?

Just for basic information, so I wonder if anyone can make an easy app that contains a menu with two buttons start and close with a black background. If you press start, the two buttons will disappear and it pops up a ball, when you move the x fi-2 the ball is rolling that way you move it. You can press the home button for returning to the menu. If you press close then stop the program.

Can anyone help me? It would have been enough for me to teach me the basic of "creative lua".
Reply With Quote

Advertisement [Remove Advertisement]

  #2  
Old 05-21-2011, 07:43 AM
TexMex TexMex is offline
Junior Member
 
Join Date: May 2011
Posts: 20
Unhappy This is what i got so far!

sheight = screen.height()
swidth = screen.width()

imgback = image.load("background.png")
imgstart = image.load("start.png")
imgclose = image.load("stopp.png")
imgball = image.load("ball.png")

touch_x = 0;
ytouch_ = 0;

imgback.draw(0,0,399,230);
imgstart.draw(50,50,150,150);
imgclose.draw(200,50,150,150);
imgscreen.update();
control.read(1)

function hi()
imgstart:close();
imgclose:close();
imgball.draw(200,115);
screen.update

while 1 do
if x >= 50 and x <= (50 + 150) and y >= 150 and y <= (150 + 50) then
hi();
end
end
Reply With Quote

  #3  
Old 05-21-2011, 08:31 AM
jbob182's Avatar
jbob182 jbob182 is offline
X-Fi2 Development Moderator
 
Join Date: Feb 2010
Location: The U.S.A.
Posts: 554
Default

Here is the code:
http://snipt.org/xKli

I hope this helps.

Last edited by jbob182; 05-21-2011 at 09:03 AM.
Reply With Quote

  #4  
Old 05-21-2011, 09:12 AM
TexMex TexMex is offline
Junior Member
 
Join Date: May 2011
Posts: 20
Talking Thank you for taking the time to help

Thank you for taking the time to help
This was useful
Reply With Quote

  #5  
Old 05-22-2011, 06:02 AM
TexMex TexMex is offline
Junior Member
 
Join Date: May 2011
Posts: 20
Help The program works fine.

The program works fine, but when I close the program and run it again then I get up the menu for about 1 sec before it closes, do you know what's wrong?

I also want the home.button to go back to my menu not to applications so any idea.

Thanks for all replies!!!
Reply With Quote

  #6  
Old 05-22-2011, 08:05 AM
jbob182's Avatar
jbob182 jbob182 is offline
X-Fi2 Development Moderator
 
Join Date: Feb 2010
Location: The U.S.A.
Posts: 554
Default

Quote:
The program works fine, but when I close the program and run it again then I get up the menu for about 1 sec before it closes, do you know what's wrong?
As yes i think i do, the way i made this, when you click the application it will also check for any button clicks

As for the home button, you simpliy put in an if statement like so
if button.click() == 1 then
if menu == "menu" then
break
elseif menu == "gameplay" then
menu="menu"
end
end

I will update the code to include this and some changes

Reply With Quote

  #7  
Old 05-22-2011, 01:14 PM
TexMex TexMex is offline
Junior Member
 
Join Date: May 2011
Posts: 20
Unhappy Thank you for helping

Thank you for helping me but when I press the home.button I come back to the menu, but if I click on something i quite the program and if I start it again and click on something the the same thing is happening.


it would be very nice if you could have this application to work fine.

Thank you for helping me to learn lua for ZEN xfi2
Reply With Quote

  #8  
Old 05-22-2011, 07:27 PM
jbob182's Avatar
jbob182 jbob182 is offline
X-Fi2 Development Moderator
 
Join Date: Feb 2010
Location: The U.S.A.
Posts: 554
Default

Keep in mind i am not actually testing my work I will look into these bugs you speak of.
Reply With Quote

  #9  
Old 05-23-2011, 03:44 AM
TexMex TexMex is offline
Junior Member
 
Join Date: May 2011
Posts: 20
Default I understand that you don't bother to test it.

I understand that you don't bother to test it.

thank you for looking into these bugs

I am looking forword to pingus dude
keep up the good work.
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 11:15 AM.