Why did I wait so long to drop by?

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
DrWho198
Posts: 3
Joined: Wed Dec 27, 2006 9:28 am

Why did I wait so long to drop by?

Post by DrWho198 »

I'm a bit ashamed to say that I started coding in Lua without completely reading the docs on lua.org...
Having this said I'll continue with a question to you all.
I have done some experementing in lua and started programming some simple games. While doing this I came across some problems with blitting images. I noticed that blitting an image that was blitted itself would make you lose alpha transpernency.

After laying lua besides me for a while I started looking at it again and noticed that there has been made changes to lua-player. I didn't check this out yet, but this new version might fix the blitting problem...

But while nosing around I noticed someting else... in the code of Lowser I found the function blitAlphaImage... how come I didn't see that function in any function list before? Is there a more complete list than the one on http://wiki.ps2dev.org/psp:lua_player:functions ?

I guess I should have come to this forum earlyer. But I guess its better late then never.

As an example of my work I'll drop you guys an example of what I'm working on right now... its nothing much yet so don't expect a full game. its not even playable in its current state! I havn't tried it on my PSP yet since its broken for now.

Image
Source: http://users.pandora.be/webbox/files/Arcade.zip

For those of you who recognise the chick, its the chick from "Newzealand Story".
I based its sprites on it.
All other graphics are my own.
In its current state it just louds the level and lets you walk around in it. No wall collision is implemented yet and running off the screen is still allowed. I'm sure it still has bugs but I just started coding it in my spare time.
youresam
Posts: 87
Joined: Sun Nov 06, 2005 1:43 am

Post by youresam »

I dont know what your talking about with blitAlphaImage (maybe it was part of the old luaplayer)

I do recomend looking here http://lua-users.org/wiki/TutorialDirectory as it takes you through pretty much every lua function and concept.

And I dont know why you would *ever* blit an image to itself Image
DrWho198
Posts: 3
Joined: Wed Dec 27, 2006 9:28 am

Post by DrWho198 »

youresam wrote:And I dont know why you would *ever* blit an image to itself Image
I guess you didn't get what I was saying.

Let me clearafy it a bit...

Lets say you have an image, I'll call that Image-A.
Image-A has transparent areas.
Now I blit part of the Image to a second Image, called Image-B.
After this, I wish to blit Image-B to screen.

So:
Image-A --Blit--> Image-B --Blit--> Screen

When doing this, the alpha transparancy is lost. It will now only blit 1 and 0 transparancy, not 50% transparanty.
I really should fix my PSP soon, so I can test the new Lua-player and see if this has been fixed.

Besides that, I guess someone could also blit an image on itself. When you wish to blit part of an image, to another place on the same image. But thats not what I was trying to do.
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Post by Shine »

DrWho198 wrote:When doing this, the alpha transparancy is lost. It will now only blit 1 and 0 transparancy, not 50% transparanty.
I really should fix my PSP soon, so I can test the new Lua-player and see if this has been fixed.
This is not fixed, but I'm writing an OpenGL implementation of Lua Player, see http://forums.ps2dev.org/viewtopic.php?t=7303 . OpenGL is very good for 2D, too, and you can use many different blending modes.
DrWho198
Posts: 3
Joined: Wed Dec 27, 2006 9:28 am

Post by DrWho198 »

thnx for the info,
I'll take a look at it when I get the chance.
Post Reply