QJ.NET | Videos | Forums | iPhone | MMORPG | Nintendo DS | Wii | PlayStation 3 | PSP | Xbox 360 | PC | Downloads | Contact Us
Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact

QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides

Go Back   QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides > Developers Corner > PSP Development, Hacks, and Homebrew > PSP Development Forum
The above video goes away if you are a member and logged in, so log in now!

Problems with a background image in LUA PGE

This is a discussion on Problems with a background image in LUA PGE within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Well, I'm doing some tests with PGE Lua but I put a background image and look what hapenns: Where there ...

Reply
 
LinkBack Thread Tools
Old 09-24-2009, 10:28 AM   #1
 
Join Date: Apr 2009
Location: Vic, Catalonia
Posts: 22
Trader Feedback: 0
Default Problems with a background image in LUA PGE

Well, I'm doing some tests with PGE Lua but I put a background image and look what hapenns:



Where there should be text these wierd things appear

This is the code I've used:
Code:
white = pge.gfx.createcolor(255, 255, 255)
yellow = pge.gfx.createcolor(255, 255, 0)
 
bg = pge.texture.load("bg.png",PGE_RAM,true)
verdana16 = pge.font.load("verdana.ttf", 16, PGE_RAM)
 
if not bg then
	error("Failed to load texture.")
end
 
if not verdana16 then
    error("Error cargando la fuente.")
end
 
 
while pge.running() do 
pge.controls.update()
pge.gfx.clearscreen()
pge.gfx.startdrawing()
 
verdana16:activate()
bg:activate()
 
bg:draw(0,0)
verdana16:printcenter(100,yellow,"Hola")
 
 
pge.gfx.enddrawing() 
pge.gfx.swapbuffers() 
end
ktix007 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-24-2009, 10:48 AM   #2
Developer and Tutor.
 
FaT3oYCG's Avatar
 
My Mood: Happy
Join Date: Jul 2007
Real First Name: Craig
Location: Widnes, England
Just Played: Life.
Posts: 1,646
Trader Feedback: 0
Default

Code:
white = pge.gfx.createcolor(255, 255, 255)
yellow = pge.gfx.createcolor(255, 255, 0)
 
bg = pge.texture.load("bg.png",PGE_RAM,true)
verdana16 = pge.font.load("verdana.ttf", 16, PGE_RAM)
 
if not bg then
	error("Failed to load texture.")
end
 
if not verdana16 then
    error("Error cargando la fuente.")
end
 
 
while pge.running() do 
pge.controls.update()
pge.gfx.clearscreen()
pge.gfx.startdrawing()
 
bg:activate()
bg:draw(0,0)

verdana16:activate()
verdana16:printcenter(100,yellow,"Hola")
 
 
pge.gfx.enddrawing() 
pge.gfx.swapbuffers() 
end
activate the font before using it otherwise it will use the last loaded texture which would be the image .
__________________
------ FaT3oYCG -----
AKA Craig, call me what you want to It's your preference.
My Website: is down for a while ... I'll bring a new one back soon.

Currently working on:
(0) PGE Gears Of War - On hold (Very large project).
(0) PS???? - A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).
FaT3oYCG is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-24-2009, 11:06 AM   #3
 
Join Date: Apr 2009
Location: Vic, Catalonia
Posts: 22
Trader Feedback: 0
Default

Quote:
Originally Posted by FaT3oYCG View Post
activate the font before using it otherwise it will use the last loaded texture which would be the image .
Thank you! It works!
ktix007 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
background , image , lua , pge , problems

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -8. The time now is 05:59 AM.



Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2009, QJ.NET. All Rights Reserved.
Contact Us