Advertising (This ad goes away for registered users. You can Login or Register)

need little help with lua player plus

Open discussions on programming specifically for the PS Vita.
Forum rules
Forum rule Nº 15 is strictly enforced in this subforum.
Locked
NoOne
Posts: 281
Joined: Wed Dec 19, 2012 3:03 pm

need little help with lua player plus

Post by NoOne »

I am trying to make an empty image and fill it with a color. Here's my code and it's not working. It throws error on Lua Player Plus. What do I need to add/fix to make it run?


white = Color.new(255,255,255)
while true do
Graphics.initBlend()
img = Graphics.createImage(10, 10)
img.clear(white)

Graphics.drawImage(10, 10, img)

Graphics.termBlend()

if Controls.check(Controls.read(), SCE_CTRL_TRIANGLE) then
System.exit()
end
Screen.flip()

end
Advertising
thesuicidalrobot
Posts: 8
Joined: Sat Aug 20, 2016 8:54 pm

Re: need little help with lua player plus

Post by thesuicidalrobot »

Code: Select all

white = Color.new(255,255,255)
while true do
Graphics.initBlend()
Screen.clear()
img = Graphics.fillRect(10, 20, 10, 20,white) 

Screen.flip() 
Graphics.termBlend()
	
if Controls.check(Controls.read(), SCE_CTRL_TRIANGLE) then
System.exit()
end

end
I simplified things a bit. I used the rectangle drawing function call. Also, you will need to clear the screen every frame, which is why I added Screen.Clear(), along with calling Screen.flip() before you call Graphics.termBlend().
Advertising
NoOne
Posts: 281
Joined: Wed Dec 19, 2012 3:03 pm

Re: need little help with lua player plus

Post by NoOne »

Then what's the use of Graphics.createImage() ?
thesuicidalrobot
Posts: 8
Joined: Sat Aug 20, 2016 8:54 pm

Re: need little help with lua player plus

Post by thesuicidalrobot »

NoOne wrote:Then what's the use of Graphics.createImage() ?
Honestly I am not sure. I tried getting it to work before in a similar way as yourself for dynamically drawn maps in Galactic Federation, but I was unsuccessful.
Rinnegatamante
VIP
Posts: 912
Joined: Sat Mar 26, 2011 10:02 am
Contact:

Re: need little help with lua player plus

Post by Rinnegatamante »

At the moment it has no practical use, in the future it will be possible to draw on images like on lpp-3ds. I'm waiting frangarcj vita2d refactor before starting working on new features for Graphics / Render modules.
If you want, visit my website: http://rinnegatamante.it :D
Locked

Return to “Programming and Security”