|
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
View previous topic :: View next topic |
Author |
Message |
-DaRealXecon-
Joined: 09 Jul 2008 Posts: 31
|
Posted: Mon Sep 08, 2008 3:46 am Post subject: From LUA to PGE-LUA, I have an little problem... |
|
|
Hi,
I try just PGE - LUA to learn but i have a small problem.... :(
I know how I can do this in LUA but in PGE-LUA there were other commands...
Code: | file = io.open("ms0:/lol.txt","r")
mysting = file:read()
file:close()
newstring = string.sub(mystring,1,12)
screen:print(x,y,"The LoL-File says:" ..newstring)
....
..
|
and in PGE-LUA....? I don't know... :(
Please help me! :p
here some tipps ;)
http://pge.luaplayer.org/index.php?option=com_content&task=view&id=23&Itemid=31
Thanks in Advance!!
Sorry for my bad English... :'( I hate it self! :D
-DaRealXecon- |
|
Back to top |
|
|
the underminer
Joined: 03 Oct 2005 Posts: 124 Location: Netherlands
|
|
Back to top |
|
|
MistPhoenix
Joined: 12 Jul 2009 Posts: 23
|
Posted: Wed Jul 22, 2009 1:07 pm Post subject: |
|
|
to load a font use the following:
Code: |
font = pge.font.load("verdana.ttf", 12, PGE_RAM) --location of ttf, pixel size, mem location(either PGE_RAM or PGE_VRAM)
white = pge.gfx.createcolor(255, 255, 155) --r,g,b
--Main Loop
while pge.running() do
pge.controls.update()
pge.gfx.startdrawing()
pge.gfx.clearscreen()
font:activate() --Activate font for drawing
font:print(40, 25, white, "Hello World!") --print the font at x, y, color, text
pge.gfx.enddrawing()
pge.gfx.swapbuffers()
end
|
Make sure that your font is activate() first as shown above only between pge.gfx.startdrawing() and pge.gfx.enddrawing(). Also your font must have a specified color which is the third argument in print() |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|