nothing works -_- but im sure its somehow possible because once i opened system.dreg file in flash1 and i could see male/female signs
Printable View
nothing works -_- but im sure its somehow possible because once i opened system.dreg file in flash1 and i could see male/female signs
Probably not. It reads things in regual like:Zitat:
Zitat von myschoo
321/4
thats pobably not completely right becuase I think there are spaces
The Lua Interpreter (lua player) doesnt read in any special characters or characters from different char sets. I dont know what that thing is, but it looks like a superscript of 321/4, and in Lua, copy and paste job of it would either crash having either an unknown error or syntax error next to 'unknown char here' or it would just read it as 321 / 4, which is whatever 321 divided by 4 is.
You could just write it a few pixels up/down and in a smaller version of the same font or write a function to do it automatically.
is there any way to check the time in lua?
is it in flash 1?
Look at the clock that came with luaplayer.
Maybe start with line 40:
To check the time in lua its something like
Code:os.time() --or something like that check the lua functions site.
Can I ask why blitting a font in Lua has to be such an asshat?
This doesn't work. I don't see anything wrong with it...Code:white = Color.new(255,255,255)
rockwell = Font.load("font/rockwell.ttf")
while true do
screen:clear()
screen:fontPrint(rockwell,0,0,"Hello World",white)
screen.waitVblankStart()
screen.flip()
end
Mind telling us the error spat at you? Ive used fonts in lua before, look at my Be Thou for the People game, used a nice, almost halo-like, font.
Allright, i'm trying to make a turn-based combat, this is only a test though, and its not done at all.
But can anyone tell me whats wrong? It says: "ERROR: loop in gettable"
Spoiler for battle.lua file:
you didnt define color white
you didnt load your sound file
you didnt define "cursor.x" and "cursor.y"
this works for meCode:white = Color.new(255,255,255)
stardustselect = { x = 30, y = 150, }
cursorstart = { x = 125, y = 100, }
david = Image.load("cross.png") -- CHANGE THIS to your own pics
man = Image.load("cross.png")
battlebg = Image.load("cross.png")
stardust = Image.load("cross.png" )
cursor = Image.load("cross.png")
screen:print(136, 136, "Prepare to fight...", white)
screen.flip()
screen.waitVblankStart(120)
while true do
screen:clear()
--Music.playFile("battle.it ")
screen:blit(0, 0, battlebg)
screen:blit(50, 100, david)
screen:blit(200, 100, man)
screen:blit(cursorstart.x , cursorstart.y, cursor)
screen:blit(stardustselect.x, stardustselect.y, stardust)
health = 100
enemyhealth = 40
pad = Controls.read()
if pad:left() then
cursorstart.x = cursorstart.x - 2
end
if pad:right() then
cursorstart.x = cursorstart.x + 2
end
if pad:up() then
cursorstart.y = cursorstart.y -2
end
if pad:down() then
cursorstart.y = cursorstart.y +2
end
if pad:start() then
System.Quit()
end
screen.waitVblankStart()
screen.flip()
end
Gameo did you post your entire code?
Your also blitting stuff outside your loop and printing stuff outside it aswell
for example this:
screen:print(136, 136, "Prepare to fight...", white)
screen.flip()
would be not even visible
i didn't post my whole script, i posted the battle.lua as i said in the spoiler text. all variables is there.
whats this?
That might be the prob
Music.playFile("battle.it ")
we told him the problem already
it doesnt work for me either -_-
Oh. And no error. It shows an empty.. black.. screen..Zitat:
Zitat von Cheez Pirate
I dont think you defined the font hight or width yet, try something like
rockwell:setPixelSizes(14 , 14)
put that right below when you loaded the font. should work
Still shows a black screen... :(
lmao it still doesnt work :D
edit. i didnt see pirates post
that is weird, IDK....try flipping around the screen.flip with the VblankStart.
Nope... :\
your code is a nazi.....
Sure is.
Im pretty sure it shoud be:Code:white = Color.new(255,255,255)
rockwell = Font.load("font/rockwell.ttf")
while true do
screen:clear()
screen:fontPrint(rockwell,0,0,"Hello World",white)
screen.waitVblankStart()
screen.flip()
end
You put screen:clear in the loop, i think that is the reasonCode:white = Color.new(255,255,255)
rockwell = Font.load("font/rockwell.ttf")
screen:clear()
while true do
screen:fontPrint(rockwell,0,0,"Hello World",white)
screen.waitVblankStart()
screen.flip()
end
-= Double Post =-
welll...
That doesn't work either...
freak: thast not the problem coz after it clears screen, it prints text and it does this 60 times/ sec
man his code is ****ing screwed up
No. It would be the same as anyone else would do it... I'm pretty sure that's the only way to do it.
not really, theres many ways to do a simple program
i never knew you can print text at 0,0 coordinates
Yea.. Actually you can. It starts at the very top-left...
Wouldnt you just put 1, 1
You could... If you wanted it 1 pixel from the left and 1 pixel from the top...
But if its at 0, 0, It will be off the screen cause of the pixel height.
No it wouldn't... Text starts at the top-left just as images do. And we all know you blit a 480x272 background using:
And if it were to start at the bottom-left (which it doesn't) you would do:Code:screen:blit(0,0,image)
Code:screen:blit(0,272,image)
Meh, Im a noob at fonts cause i don't use them.
Just putting in my $.2
Well even without fonts you can still print at 0,0.
Well i woudl think since its a background thats 480x272 then it will do the whole screen, But if its a font and since its small it might not print correctly, Also, Have you set the font's size?
width, height Font:getTextSize(string)