Sprite : some requests

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
[blendman]
Enthusiast
Enthusiast
Posts: 297
Joined: Thu Apr 07, 2011 1:14 pm
Location: 3 arks
Contact:

Sprite : some requests

Post by [blendman] »

Hi

It would be great if we could have thoses features :

1) Center (rotation & zoom)
- CenterSpriteRotation(#sprite,x,y) : to change the center for the rotation of the sprite. For the moment, the center is in (width/2,height/2)
- CenterSpriteZoom(#sprite,centerX,centery) : to change the center for the zoom of the sprite (with zoomsprite()). Actually, this center is in (0,0)

The center for operations (rotation, zoom) are essential : for exemple, to create a sort of skeleton system, we need to rotate the sprite around a predefined center.

2) Repeated image
ClipSprite(#Sprite, x, y, Largeur, Hauteur[,repeat]) : option repeat = repeat the texture on the sprite, to have a background repeated for example.
or SpriteUV(sprite,u,v), to repeat the texture in u * v

3) FlipSprite(#Sprite, flipH, FlipV) or MirorSprite(#sprite, flipH, flipV) :
Value for flipH & flipV: 0 = no flip, 1 = flip

or an option to see the backface of the sprite with transformSprite()
TransformSprite(1,0,0,-width,0,-wifth,height,0,height) is ok in openGl (we can see the mirored sprite), but doesn't work in directX.

4) sprite color
For the moment, when we use the color for a sprite, the image disappear, and the sprite became a flat image with the flat color.
It could be better to color the the sprite, like in 3D (in coloring the vertices).
So we could see the image with a sort of hue of color.
If we use an orange color, the sprite & his image will be colored in orange.

5) UseBuffer()
The return of UseBuffer() (or an equivalent) : to have the possibility to draw or display the graphics on a sprite (displaytransparentsprite()...).



Pour Fred (fr)


[EDIT de mars 2016]
Pour certains des outils que je développe, j'ai crée un système de sprite qui me permet d'avoir :
- flipsprite()
- le zoom centré en X,Y
- l'offset

Par contre, j'ai toujours le problème lié aux couleur des sprites, qui devrait être en mode multiply et non remplacer les couleurs du sprite.
[/edit]


Sprite : nouvelle commande

1) Centre (rotation et zoom séparés mais définissables, comme actuellement)
- CenterSpriteRotation(#sprite,centerX,centerY) : pour changer le centre de rotation du sprite. Actuellement, ce centre est en (width/2,height/2)
- CenterSpriteZoom(#sprite,centerX,centery) : pour changer le centre du sprite pour zoomsprite(). Actuellement, ce centre est en (0,0)

Les centres sont essentiels pour pouvoir obtenir des opérations sur les sprites. PAr exemple, à l'heure actuelle, on ne peut pas faire une rotation autour d'un centre particulier. Donc, on ne peut pas concevoir de système comme "skeleton" (des personnages animé dont les sprites sont collés et interagissent entre eux).
Par exemple :
- j'ai 2 sprites : bras et avant-bras.
- si je veux tourner un avant-bras dont le centre serait le coude, pour le moment, c'est impossible ;).

2) Image répété sur un sprite
ClipSprite(#Sprite, x, y, Largeur, Hauteur[,repeat]) : option repeat = répéter l'image sur le sprite, par exemple pour avoir un sol qui se répète.
ou SpriteUV(sprite,u,v) : pour répéter l'image en u * v
(il faudrait une option très rapide, comme en 3D, en changeant l'uv, on peut faire du scrolling)

3) FlipSprite(#Sprite, flipH, flipV) ou MirorSprite(#sprite, flipH, flipV)
FlipH = miroir horizontal. 1 = miroir à gauche, 0 = normal .
FlipV = miroir vertical. 1 = miroir verticale en bas , 0 = normal.

Ou alors:
Une option pour voir les faces "cachées" (backface culling ?) des sprites avec transformSprite()
TransformSprite(1,0,0,-width,0,-wifth,height,0,height) : ça fonctionne en OpenGL, mais pas avec DirectX.

4) Sprite color
Actuellement, quand on modifie la couleur d'un sprite, on ne voit pas l'image colorée, mais on obtient avec une couleur unie, ayant la forme du sprite original.
Ce serait mieux d'avoir un sprite coloré (comme quand on colore les vertices en 3D).

5) UseBuffer()
UseBuffer() :avoir à nouveau la possibilité de dessiner sur un sprite ce qu'on voit sur l'écran (displaytransparentsprite()...), ce qui permettrait du renderToTexture par exemple.
Last edited by [blendman] on Sun Mar 13, 2016 1:21 pm, edited 5 times in total.
User avatar
thyphoon
Enthusiast
Enthusiast
Posts: 345
Joined: Sat Dec 25, 2004 2:37 pm

Re: Sprite : some requests

Post by thyphoon »

+1
juankprada
User
User
Posts: 62
Joined: Tue Mar 18, 2014 4:25 pm
Location: Bogotá, Colombia

Re: Sprite : some requests

Post by juankprada »

+10
User avatar
thyphoon
Enthusiast
Enthusiast
Posts: 345
Joined: Sat Dec 25, 2004 2:37 pm

Re: Sprite : some requests

Post by thyphoon »

c'est dommage il y a quelques commandes "simple" qu'on attend depuis si longtemps ... :(
Post Reply