Better directx sprite support please!

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Shagwana.

I would like to see improved sprite support, give us the ability to;

Draw transparents sprite using a user selected color for the transparency, not limit us to colour 0,0,0 (for >256 color images)
Ability to draw only a selected area of a sprite to the screen!
A copy sprite command
A way to grab color info off a directx screen or/and sprite
A grab sprite command (from screen)
A few commands to aid in the exchange between image and sprites

There is a whole lot more that could be usefull, but this could be a start. So what do you think of that then?

http://www.sublimegames.com
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by cfriedel.

From my experience, some of this is already possible.

On transparent sprites, if you want a different color to be transparent, change the palette for the image so that the color you want to be transparent is color 0 for the palette. This should allow you to do what you want to do.

To draw a selected portion of a sprite you can simply put one sprite up, then overlap it with another or a blank. While it isn't the best solution, it does work and should be good for most cases.

Some of the other stuff would have to be added (at least this is my belief). I am sure Fred will be albe to answer this a lot better than I. Hope this helps.


Cliff
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Shagwana.
On transparent sprites, if you want a different color to be transparent, change the palette for the image so that the color you want to be transparent is color 0 for the palette. This should allow you to do what you want to do.
It is one way, but in my sprites I like to use the black color!. Granted I could change it to 1,1,1 or something, but that is a big botch/cludge!. The ideal solution would be to let the user to select the mask color!.


http://www.sublimegames.com
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.
Draw transparents sprite using a user selected color for the transparency, not limit us to colour 0,0,0 (for >256 color images)
Ability to draw only a selected area of a sprite to the screen!
A copy sprite command
A way to grab color info off a directx screen or/and sprite
A grab sprite command (from screen)
A few commands to aid in the exchange between image and sprites

There is a whole lot more that could be usefull, but this could be a start. So what do you think of that then?
What I think ? I think than I've done all the requested commands: CopySprite(), GrabSprite(), ClipSprite() and TransparentSpriteColor(). About the way to get color on a screen, you can use the StartDrawing(ScreenOutput()) command with Plot() and Point(). It should work, even if it's slow.. I will add direct access to the surface memory, but it will be slow, as a random GFX card access is very very slow. Anyway, using the StartSpecialFX() mode, you could manipulate byte very quickly.

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Shagwana.
What I think ? I think than I've done all the requested commands: CopySprite(), GrabSprite(), ClipSprite() and TransparentSpriteColor().
Does this mean they are already in purebasic or in a future update If so, thanks in advance! .


http://www.sublimegames.com
Post Reply