Page 1 of 1

need little help with lua player plus

Posted: Fri May 26, 2017 7:10 pm
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

Re: need little help with lua player plus

Posted: Sat May 27, 2017 10:15 pm
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().

Re: need little help with lua player plus

Posted: Sun May 28, 2017 4:05 am
by NoOne
Then what's the use of Graphics.createImage() ?

Re: need little help with lua player plus

Posted: Sun May 28, 2017 9:29 pm
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.

Re: need little help with lua player plus

Posted: Wed May 31, 2017 7:22 pm
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.