Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
19 June, 2013, 13:12:12 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: 1 [2]   Go Down
  Print  
Author Topic: Taking my hand at Lua -  (Read 704 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
jwalker
LV7 Elite (Next: 700)
*******
Offline Offline

Gender: Male
Last Login: 16 June, 2013, 15:19:18
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 617


Total Post Ratings: +12

View Profile
« Reply #15 on: 08 June, 2012, 20:16:04 »
0

It is, but he can use it as a reference once he learns more about how to program.
Logged


My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!


Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads
cyanophycean314
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 03 May, 2013, 19:28:34
Date Registered: 07 December, 2011, 02:44:32
Location: Somewhere?
Posts: 363


Total Post Ratings: +42

View Profile
« Reply #16 on: 08 June, 2012, 20:57:26 »
0

This is basically the menu I used in my first few games. You can change it to to be more flexible, and use objects (I don't think you know that yet.)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--Menu

function on.paint(gc)
if not init then
x = 25
y = 65
val = 1
end
gc:drawString("Option 1",40,60,"top")
gc:drawString("Option 2",40,75,"top")
gc:drawString("Option 3",40,90,"top")
gc:drawString("Option 4",40,105,"top")
gc:fillRect(x,y,10,10)
end

function on.arrowKey(dir)
--Moves the cursor
if dir == "up" then
y = y - 15
val = val - 1
elseif dir == "down" then
y = y + 15
val = val + 1
end
--Wrap around
if val == 0 then
y = 110
val = 4
elseif val == 5 then
y = 65
val = 1
end
platform.window:invalidate()
end

function on.enterKey()
if val == "whatever you want" then
"DO THIS"
elseif val == "this option" then
"DO THIS"
end
platform.window:invalidate()
end
Logged

Pages: 1 [2]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.478 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.