Fixed fast_tilemap and texture_atlas_repeat examples.
This commit is contained in:
@@ -39,7 +39,7 @@ local function setTile( meshData, pos, texcoord )
|
||||
local texelSize = Vector2:new( 1 / tilemap.texSize.x, 1 / tilemap.texSize.y )
|
||||
|
||||
for i, v in ipairs( QUAD.VERTICES ) do
|
||||
table.insert( meshData.vertices, ( pos + v ):scale( tilemap.tileSize ) )
|
||||
table.insert( meshData.vertices, ( Vector3:temp( pos.x + v.x, pos.y + v.y, 0 ) ):scale( tilemap.tileSize ) )
|
||||
table.insert( meshData.texcoords, ( QUAD.TEXCOORDS[i] + texcoord ) * texelSize:scale( tilemap.tileSize ) )
|
||||
table.insert( meshData.colors, RL.WHITE )
|
||||
end
|
||||
|
||||
@@ -28,8 +28,8 @@ function RL.draw()
|
||||
RL.ClearBackground( RL.RAYWHITE )
|
||||
|
||||
RL.BeginShaderMode( shader )
|
||||
RL.DrawTexturePro( atlas, { 0, 0, 32, 32 }, { 0, 0, 64, 64 }, { 0.0 }, 0.0, RL.WHITE )
|
||||
RL.DrawTexturePro( atlas, { 32, 0, 32, 32 }, { 0, 64, 128, 64 }, { 0.0 }, 0.0, RL.WHITE )
|
||||
RL.DrawTexturePro( atlas, { 0, 0, 32, 32 }, { 0, 0, 64, 64 }, { 0.0, 0.0 }, 0.0, RL.WHITE )
|
||||
RL.DrawTexturePro( atlas, { 32, 0, 32, 32 }, { 0, 64, 128, 64 }, { 0.0, 0.0 }, 0.0, RL.WHITE )
|
||||
RL.DrawTriangle( { 32, 200 }, { 128, 400 }, { 320, 240 }, RL.WHITE )
|
||||
RL.EndShaderMode()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user