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!

Help with lua

This is a discussion on Help with lua within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Hi all, Can someone tell me where if there is any way to make the image angle rotate in lua?? ...

Reply
 
LinkBack Thread Tools
Old 06-01-2009, 07:46 PM   #1
 
Join Date: May 2008
Posts: 93
Trader Feedback: 0
Default Help with lua

Hi all,
Can someone tell me where if there is any way to make the image angle rotate in lua??
Aren't there any libaries or something for that?
Predricted is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-01-2009, 07:58 PM   #2
 
Join Date: Apr 2009
Posts: 16
Trader Feedback: 0
Default

I think it is Image.rotate(IMAGE,DEGREE ), I might be wrong and I think that is for LPHMv2(still might be same for other versions)
jackrunner is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-01-2009, 11:13 PM   #3
Enter Custom Title
 
dan369's Avatar
 
Join Date: Jan 2008
Real First Name: Dan
Location: Wales, cardiff
Just Played: Overlord 2
Posts: 1,308
Blog Entries: 1
Trader Feedback: 0
Default

Your most likely gunna have to do it yourself.
dan369 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-02-2009, 01:04 AM   #4
 
Join Date: May 2009
Real First Name: Steven
Location: California
Posts: 75
Trader Feedback: 0
Default

Quote:
Originally Posted by dan369 View Post
Your most likely gunna have to do it yourself.
This would be the simplest way. But that would make the hardware work more, add more to memory, and make this person work more.


In the latest Luaplayer HMv2 you do it like jackrunner says, but there is a bit more.

Code:
--Load the image you want to rotate
TestI = Image.load("test.png")

--Loop
while true do

--Start Graphics Process
screen.startDraw()

--Blit your image
Image.blit(100,100,TestI)

--Rotate your image
Image.rotate(0,0,180,TestI)

--End Graphics Process, end loop, flipscreen
screen.endDraw()
screen.flipscreen()
end
So basically you take your image that's being blitted and you use:

Image.rotate(X,Y,Rotation in Degrees, Image File)

When you use it whatever is in X,Y will be the images new X,Y.

The next variable is controls rotation so 180 degrees will turn the image upside down.

The final variable is your image file, in the example it was simply TestI.

Keep in mind you must have the image blitted or it will freeze your PSP.
Xteaph-N is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-02-2009, 03:53 AM   #5
Enter Custom Title
 
dan369's Avatar
 
Join Date: Jan 2008
Real First Name: Dan
Location: Wales, cardiff
Just Played: Overlord 2
Posts: 1,308
Blog Entries: 1
Trader Feedback: 0
Default

Work more. Not really. If there function for it is there then use it but if your not using HMv2 then you might as well do it yourself.
dan369 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-02-2009, 06:55 AM   #6
 
Join Date: May 2008
Posts: 93
Trader Feedback: 0
Default

Quote:
Originally Posted by Xteaph-N View Post
This would be the simplest way. But that would make the hardware work more, add more to memory, and make this person work more.


In the latest Luaplayer HMv2 you do it like jackrunner says, but there is a bit more.

Code:
--Load the image you want to rotate
TestI = Image.load("test.png")

--Loop
while true do

--Start Graphics Process
screen.startDraw()

--Blit your image
Image.blit(100,100,TestI)

--Rotate your image
Image.rotate(0,0,180,TestI)

--End Graphics Process, end loop, flipscreen
screen.endDraw()
screen.flipscreen()
end
So basically you take your image that's being blitted and you use:

Image.rotate(X,Y,Rotation in Degrees, Image File)

When you use it whatever is in X,Y will be the images new X,Y.

The next variable is controls rotation so 180 degrees will turn the image upside down.

The final variable is your image file, in the example it was simply TestI.

Keep in mind you must have the image blitted or it will freeze your PSP.
Sorry this may sound stupid but i don't understand, since i've only worked with luaplayer windows and libaries..
And when i put your script in it it dont works
it gives this error
rotate.lua:8 attempt to call field 'startDraw' (a nil value)...
Predricted is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-02-2009, 02:16 PM   #7
 
Join Date: May 2009
Real First Name: Steven
Location: California
Posts: 75
Trader Feedback: 0
Default

Quote:
Originally Posted by Predricted View Post
Sorry this may sound stupid but i don't understand, since i've only worked with luaplayer windows and libaries..
And when i put your script in it it dont works
it gives this error
rotate.lua:8 attempt to call field 'startDraw' (a nil value)...
Since your using the original Luaplayer there are only 2 ways rotating the image in a photo editor, like dan369 says, or you can rotate your image in 3D GU. Though keep in mind 3D GU functions don't show up in luaplayer windows.

I do not have a PSP capable of running the luaplayer your using. Merick of evilmana shows us how to do this function in GU.

http://www.forums.evilmana.com/index.php?topic=676.0

Last edited by Xteaph-N; 06-02-2009 at 04:08 PM..
Xteaph-N is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
lua

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 03:56 PM.



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