Page 3 of 3
Posted: Thu May 28, 2009 8:51 pm
by Kaeru Gaman
djes wrote:It's a mistake. I thought that tip = hint. My english is so bad :'(
ah, sorry.
I forgot to put an "also" into my sentence.
"hint" or "clue" is the normal meaning, "gratuity" is an additional, slang meaning.
... so, in french there is no other meaning of "tip"?
Posted: Thu May 28, 2009 9:59 pm
by djes
Hum... Not really. In french, a TIP is something like a special cheque (Titre Interbancaire de Paiement)
Re: ClipSprite3D for DirectX7 / DirectX9
Posted: Tue Aug 25, 2009 12:56 pm
by thepastrycook
Fluid Byte wrote:the famous ClipSprite3D
Thank you, l' use since the month April and it's perfect
very nice

Re: ClipSprite3D for DirectX7 / DirectX9
Posted: Thu Apr 22, 2010 10:11 pm
by STARGÅTE
Why the queries for x, y, width and height there are in it?
Without these queries, you can still use one more effect, the tile-effect:
Code: Select all
InitSprite()
InitSprite3D()
; DirectX9
Structure D3DTLVERTEX
x.f:y.f:z.f
rhw.f:Color.l
tu.f:tv.f
EndStructure
Structure PB_DX9Sprite3D
TexRes.l ; TexRes
Vertice.D3DTLVERTEX[4] ; The 4 vertices for the rectangle sprite
TmpVertice.D3DTLVERTEX[4] ; The 4 vertices for the rectangle sprite
Width.l ; width set with ZoomSprite3D()
Height.l ; height set with ZoomSprite3D()
RealWidth.l
RealHeight.l
Angle.f
Transformed.l
EndStructure
Procedure ClipSprite3D(Sprite3D, x, y, Width, Height)
Protected *Sprite3D.PB_DX9Sprite3D = IsSprite3D(Sprite3D)
With *Sprite3D
\Vertice[0]\tu = x / \RealWidth
\Vertice[0]\tv = y / \RealHeight
\Vertice[1]\tu = (x + Width) / \RealWidth
\Vertice[1]\tv = y / \RealHeight
\Vertice[2]\tu = x / \RealWidth
\Vertice[2]\tv = (y + Height) / \RealHeight
\Vertice[3]\tu = (x + Width) / \RealWidth
\Vertice[3]\tv = (y + Height) / \RealHeight
EndWith
EndProcedure
OpenWindow(0, 0, 0, 800, 600, "SCREEN", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, 800, 600, 0, 0, 0)
Sprite3DQuality(1)
CreateSprite(1, 32, 32, #PB_Sprite_Texture)
StartDrawing(SpriteOutput(1))
Box(0,0,16,16,$FFFF00)
Box(16,16,16,16,$00FFFF)
StopDrawing()
CreateSprite3D(1, 1)
Repeat
ClearScreen(0)
Start3D()
ClipSprite3D(1, 0, 0, 32, 32)
RotateSprite3D(1, 0, #PB_Absolute)
ZoomSprite3D(1, 32, 32)
DisplaySprite3D(1, 128, 64)
Time.f = ElapsedMilliseconds()/1000
ClipSprite3D(1, Mod(Time*50,256), Mod(Time*70,256), 256, 256)
RotateSprite3D(1, Time*25, #PB_Absolute)
ZoomSprite3D(1, 256, 256)
DisplaySprite3D(1, 128, 128)
Stop3D()
FlipBuffers()
Until WindowEvent() = #PB_Event_CloseWindow
Re: ClipSprite3D for DirectX7 / DirectX9
Posted: Fri Apr 23, 2010 8:54 pm
by Fluid Byte
I don't know exactly but I guess for backwards compatibility with older cards and DirectX 7.
Re: ClipSprite3D for DirectX7 / DirectX9
Posted: Fri Apr 23, 2010 9:04 pm
by STARGÅTE
i see, it have a bug.
it's better to use:
Code: Select all
ClipSprite3D(1, Mod(Time*50,256), Mod(Time*70,256), 256, 256)