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 
MurgaLua Compiler
Author Message
iGame3D
Moderator
***


Posts: 231
Group: Moderators
Joined: Apr 2007
Status: Offline
Reputation: 0
Post: #1
RE: MurgaLua Compiler

Code:
-- path to compiled binary
pathToMurgaLua = string.gsub(murgaLua_ExePath,"(.*)/.*","%1")
appImage = pathToMurgaLua.."/background.gif"

-- will return correct path if cd to scripts path prior to running script
CurDirImage = lfs.currentdir() .."/background.gif"

fltk.fl_register_images()
-- if the file exists at same path as binary
if lfs.attributes(appImage) ~= nil then  img_back = Fl_Shared_Image.get(appImage) end

-- if the file exists at same path as script
if lfs.attributes(CurDirImage) ~= nil  then img_back = Fl_Shared_Image.get(CurDirImage) end


Using this I can get a script and/or its compiled version to find the image.
I'll try something similiar with the bezier example, it uses a subdirectory.
I don't understand require so I'll cheat it again.

-- Groovy, Bezier Example compiled with images

This post was last modified: 02-01-2008 08:19 AM by iGame3D.

02-01-2008 08:05 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
MurgaLua Compiler - iGame3D - 01-31-2008, 09:54 PM
RE: MurgaLua Compiler - mikshaw - 02-01-2008, 12:00 AM
RE: MurgaLua Compiler - JohnMurga - 02-01-2008, 02:45 AM
RE: MurgaLua Compiler - JohnMurga - 02-01-2008, 02:50 AM
RE: MurgaLua Compiler - iGame3D - 02-01-2008 08:05 AM
RE: MurgaLua Compiler - Juergen - 02-01-2008, 09:08 AM
RE: MurgaLua Compiler - JohnMurga - 02-01-2008, 09:38 AM
RE: MurgaLua Compiler - iGame3D - 02-01-2008, 03:26 PM
RE: MurgaLua Compiler - Juergen - 02-01-2008, 09:08 PM
RE: MurgaLua Compiler - JohnMurga - 02-01-2008, 11:47 PM
RE: MurgaLua Compiler - Juergen - 02-06-2008, 04:33 AM
RE: MurgaLua Compiler - JohnMurga - 02-06-2008, 08:21 AM
MurgaLua Compiler Platforms - iGame3D - 02-06-2008, 09:24 AM
RE: MurgaLua Compiler - Juergen - 02-06-2008, 09:29 AM
RE: MurgaLua Compiler - Juergen - 02-06-2008, 08:14 PM

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

Forum Jump: