Модератор: Mikle
Bazilius писал(а):один глобальный спрайт для всех текстур приложения
Type TileType
Texture As Direct3DTexture8
Sprite As D3DXSprite
End Type
Public Tile As TileType
Type MouseType
Position As D3DVector2
Texture As Direct3DTexture8
Sprite As D3DXSprite
End Type
Public Mouse As MouseType
...
Public Sub Render()
For Y = 0 To 9
For X = 0 To 9
Tile.Sprite.Draw Tile.Texture, RECT(0, 0, 32, 32), Vec2(1, 1), Vec2(0, 0), 0, Vec2(X * 32, Y * 32), D3DColorARGB(255, 255, 255, 255)
Next X
Next Y
Mouse.Sprite.Draw Mouse.Texture, RECT(0, 0, 32, 32), Vec2(1, 1), Vec2(0, 0), 0, Mouse.Position, D3DColorARGB(255, 255, 255, 255)
End Sub
Type TileType
Texture As Direct3DTexture8
End Type
Public Tile As TileType
Type MouseType
Position As D3DVector2
Texture As Direct3DTexture8
End Type
Public Mouse As MouseType
Public gSprite As D3DXSprite
...
Public Sub Render()
For Y = 0 To 9
For X = 0 To 9
gSprite.Draw Tile.Texture, RECT(0, 0, 32, 32), Vec2(1, 1), Vec2(0, 0), 0, Vec2(X * 32, Y * 32), D3DColorARGB(255, 255, 255, 255)
Next X
Next Y
gSprite.Draw Mouse.Texture, RECT(0, 0, 32, 32), Vec2(1, 1), Vec2(0, 0), 0, Mouse.Position, D3DColorARGB(255, 255, 255, 255)
End Sub
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 7