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.
Post Reply
User avatar
NoOne
Posts: 281
Joined: Wed Dec 19, 2012 3:03 pm

need little help with lua player plus

Post by NoOne » Fri May 26, 2017 7:10 pm

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 » Sat May 27, 2017 10:15 pm

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

User avatar
NoOne
Posts: 281
Joined: Wed Dec 19, 2012 3:03 pm

Re: need little help with lua player plus

Post by NoOne » Sun May 28, 2017 4:05 am

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

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.

User avatar
Rinnegatamante
VIP
Posts: 680
Joined: Sat Mar 26, 2011 10:02 am
Contact:

Re: need little help with lua player plus

Post by Rinnegatamante » Wed May 31, 2017 7:22 pm

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

Post Reply

Return to “Programming and Security”