You won't be able to use Sprites without using a Shader., due to Affine Texturing issues.
+ Code Snippet// Common Constants
#Constant True -1
#Constant False 0
#Constant Null 0
#Constant Enable 1
#Constant Disable 0
#Constant KEY_ESCAPE 27
Global AppRunning As Integer : AppRunning = True
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "starwars" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( Disable, Disable, Disable, Disable ) // allow both portrait and landscape on mobile devices
SetSyncRate( 0, Enable ) // 30fps instead of 60 to save battery
SetScissor( Null, Null, Null, Null ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( Enable )
Type Vector2
X As Float
Y As Float
EndType
Type Direction
Left As Vector2
Right As Vector2
EndType
Type Rect
Top As Direction
Bottom As Direction
EndType
UV As Rect
Global imgCrawl As Integer : imgCrawl = LoadImage( "Crawl.png" )
Global sprCrawl As Integer : sprCrawl = CreateSprite( CreateImageColor( 0, 0, 0, 255 ) )
SetSpriteSize( sprCrawl, GetVirtualWidth(), GetVirtualHeight() )
SetSpriteImage( sprCrawl, imgCrawl )
UV.Top.Left = CreateVector2( -0.5, 0.0 )
UV.Bottom.Left = CreateVector2( 0.0, 0.3 )
UV.Top.Right = CreateVector2( 1.5, 0.0 )
UV.Bottom.Right = CreateVector2( 1.0, 0.3 )
SetSpriteUV( sprCrawl, UV.Top.Left.X, UV.Top.Left.Y, UV.Bottom.Left.X, UV.Bottom.Left.Y, UV.Top.Right.X, UV.Top.Right.Y, UV.Bottom.Right.X, UV.Bottom.Right.Y )
// Main Loop
Repeat
If GetRawKeyPressed( KEY_ESCAPE )
AppRunning = Not( AppRunning )
EndIf
Sync()
Until Not( AppRunning )
// Clean Up
DeleteSprite( sprCrawl )
DeleteImage( imgCrawl )
End
// Functions
Function CreateVector2( X As Float, Y As Float )
Local Output As Vector2
Output.X = X
Output.Y = Y
EndFunction Output