-- Images
author = Image.load("images/author.png") -- 480 x 272
luaplayer = Image.load("images/lua.png") -- 480 x 272
premenu = Image.load("images/premenu.png") -- 480 x 272
menu = Image.load("images/menu.png") -- 480 x 272
gameboard = Image.load("images/board.png") -- 480 x 272
icon1 = Image.load("images/icon1.png") -- 30 x 30
icon2 = Image.load("images/icon2.png") -- 30 x 30
-- Color
white = Color.new(255,255,255)
while true do -- Start the loop
screen.flip() -- Screen Buffer
screen.waitVblankStart()
screen:blit(0,0,luaplayer,true)
screen:blit(0,0,author,false)
screen:blit(0,0,premenu,false)
screen:blit(0,0,menu,false)
end
Problem With My Code
Moderators: Shine, Insert_witty_name
Problem With My Code
Hello everyone, I was wondering because I'm a newbie to lua coding why my application was popping up in windows lua then disappearing straight away there is a copy of the cody below can someone please take a look.
I'm confused now...
I have simplified my code right down and it is still failing, any ideas?
author = Image.load("images/author.png") -- 480 x 272
luaplayer = Image.load("images/lua.png") -- 480 x 272
premenu = Image.load("images/premenu.png") -- 480 x 272
menu = Image.load("images/menu.png") -- 480 x 272
gameboard = Image.load("images/board.png") -- 480 x 272
icon1 = Image.load("images/icon1.png") -- 30 x 30
icon2 = Image.load("images/icon2.png") -- 30 x 30
white = Color.new(255,255,255)
while true do
pad = Controls.read()
screen:clear()
screen:blit(0,0,author)
screen.waitVblankStart()
screen.flip()
end
right after the screen:blit line make a new line like this:
Code: Select all
screen:print(0,0,"",black)
and define black at the beginning of the file:
black = Color.new(0,0,0)
- be2003
blog
blog
Thanks
Ok I am glad your helping me out but it's still just flashing up and disappearing again.
Here is a sample of my current code
Thanks again.
Here is a sample of my current code
I would be very grateful if you could make the code correct and send it back to me in full.author = Image.load("images/author.png") -- 480 x 272
luaplayer = Image.load("images/lua.png") -- 480 x 272
premenu = Image.load("images/premenu.png") -- 480 x 272
menu = Image.load("images/menu.png") -- 480 x 272
gameboard = Image.load("images/board.png") -- 480 x 272
icon1 = Image.load("images/icon1.png") -- 30 x 30
icon2 = Image.load("images/icon2.png") -- 30 x 30
white = Color.new(255,255,255)
black = Color.new(0,0,0)
while true do
pad = Controls.read()
screen:clear()
screen:blit(0,0,author)
screen:print(0,0,"",black)
screen.waitVblankStart()
screen.flip()
screen.flip()
end
Thanks again.
Support
I would like some full help with this program so if you would like to help me with this lua program please either PM me or e-mail on
Thanks
So you know
I have re-written my code and it is all working ok but I need to find a way to make the program watch one image for abuot 3 seconds then change to another for 3 seconds any ideas?
Code: Select all
-- switches between 2 images at 5 sec intervals
temp = 0
tempimg = 0 -- or false
imga = Image.load("jmtjhndb.png")
imgb = Image.load("jmg.png")
topscrn=Image.createEmpty(480,272)
while not Controls.read():start() do
temp=temp+1
if temp==3 then temp==1 end
if temp==1 then
tempimg=imga
end
if temp==2 then
tempimg=imgb
end
topscrn:blit(0,0,tempimg)
screen:blit(0,0,topscrn)
screen.waitVblankStart()
screen:flip()
System.sleep(300)
end
- be2003
blog
blog