News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
iGame3D MurgaLua'd
Author Message
iGame3D
Moderator
***


Posts: 231
Group: Moderators
Joined: Apr 2007
Status: Offline
Reputation: 0
Post: #1
iGame3D Play and Edit Mode Toggle

ok here's the same code as above, only "hello world" is now a clock
and the escape key toggles between play and edit modes.

In edit mode you'll be able to move the text box around with the mouse.

Code:
gTextboxes={}
gTextboxes[1]=make(ig3d_text_box, "Data/FontPngs/default32_1.png")
setText_boxInfo(gTextboxes[1], IG3D_COLOR, 1.0,1.0,1.0,1)
setText_boxInfo(gTextboxes[1], IG3D_POSITION, 45 , 45)
setText_boxInfo(gTextboxes[1], IG3D_SIZE, 64)

function time()
return string.sub(os.date(),11,20)
end

--define a function for the game loop
function gamemodefunc()
    setText_boxInfo(gTextboxes[1], IG3D_TEXT, time())
    fltk_update();
    char,code,name=input(false)
    --Toggle to edit mode on escape key down
    if name=="Escape" then ig3d_SetMode_i(1) end
end

--define a function to handle editing mode events
function editmodefunc()
    setText_boxInfo(gTextboxes[1], IG3D_TEXT, time())
    fltk_update();
    char,code,name=input(false)
--Toggle to play mode on escape key down
    if name=="Escape" then ig3d_SetMode_i(4) end
end

game_func= gamemodefunc--tell engine what the game loop is
edit_func= editmodefunc--tell engine what the edit loop is
ig3d_SetMode_i(4)  --- play game!


Next up a murgaLua UI.

This post was last modified: 11-26-2007 05:58 AM by iGame3D.

11-26-2007 05:30 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
iGame3D MurgaLua'd - iGame3D - 11-24-2007, 06:54 PM
RE: iGame3D MurgaLua'd - chrimo - 11-24-2007, 09:36 PM
RE: iGame3D MurgaLua'd - chrimo - 11-24-2007, 09:53 PM
RE: iGame3D MurgaLua'd - chrimo - 11-24-2007, 10:13 PM
RE: iGame3D MurgaLua'd - chrimo - 11-24-2007, 10:50 PM
RE: iGame3D MurgaLua'd - chrimo - 11-24-2007, 11:21 PM
RE: iGame3D MurgaLua'd - Tobi - 11-25-2007, 04:36 AM
RE: iGame3D MurgaLua'd - iGame3D - 11-25-2007, 05:14 AM
RE: iGame3D MurgaLua'd - Tobi - 11-25-2007, 05:37 AM
RE: iGame3D MurgaLua'd - chrimo - 11-25-2007, 06:16 AM
RE: iGame3D MurgaLua'd - chrimo - 11-25-2007, 06:38 AM
iGame3D Hello World - iGame3D - 11-25-2007, 09:20 AM
iGame3D Play and Edit Mode Toggle - iGame3D - 11-26-2007 05:30 AM
RE: iGame3D MurgaLua'd - chrimo - 11-27-2007, 06:01 AM
RE: iGame3D MurgaLua'd - chrimo - 11-28-2007, 12:26 AM
RE: iGame3D MurgaLua'd - Tobi - 11-28-2007, 06:04 AM
RE: iGame3D MurgaLua'd - chrimo - 11-28-2007, 06:32 AM
RE: iGame3D MurgaLua'd - chrimo - 11-28-2007, 06:36 AM
RE: iGame3D MurgaLua'd - Tobi - 11-28-2007, 07:11 AM
RE: iGame3D MurgaLua'd - chrimo - 11-28-2007, 07:29 AM
RE: iGame3D MurgaLua'd - Tobi - 11-28-2007, 07:43 AM
RE: iGame3D MurgaLua'd - chrimo - 11-29-2007, 02:58 AM
RE: iGame3D MurgaLua'd - iGame3D - 11-29-2007, 03:25 AM
RE: iGame3D MurgaLua'd - chrimo - 11-29-2007, 03:50 AM
RE: iGame3D MurgaLua'd - iGame3D - 11-29-2007, 04:02 AM
RE: iGame3D MurgaLua'd - chrimo - 11-29-2007, 06:25 AM
RE: iGame3D MurgaLua'd - Tobi - 11-29-2007, 07:07 AM
RE: iGame3D MurgaLua'd - chrimo - 11-29-2007, 07:29 AM
RE: iGame3D MurgaLua'd - Tobi - 11-29-2007, 07:45 AM
RE: iGame3D MurgaLua'd - Tobi - 11-29-2007, 07:52 AM
RE: iGame3D MurgaLua'd - chrimo - 11-29-2007, 07:42 AM
RE: iGame3D Data Directories - iGame3D - 11-29-2007, 09:10 AM
RE: iGame3D MurgaLua'd - chrimo - 11-29-2007, 09:24 AM
RE: iGame3D MurgaLua'd - chrimo - 12-02-2007, 10:56 PM
RE: iGame3D MurgaLua'd - iGame3D - 12-03-2007, 04:46 AM
RE: iGame3D MurgaLua'd - chrimo - 12-03-2007, 06:50 AM
RE: iGame3D MurgaLua'd - Tobi - 12-03-2007, 07:09 AM
RE: iGame3D MurgaLua'd - chrimo - 12-09-2007, 12:18 AM
RE: iGame3D MurgaLua'd - chrimo - 12-09-2007, 09:32 PM
RE: iGame3D MurgaLua'd - mikshaw - 12-12-2007, 02:47 PM
RE: iGame3D MurgaLua'd - chrimo - 12-12-2007, 08:35 PM
RE: iGame3D MurgaLua'd - mikshaw - 12-13-2007, 01:31 AM
RE: iGame3D MurgaLua'd - iGame3D - 12-13-2007, 02:55 AM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: