I'm running into an issue where the wrong image is being drawn; my entire code is included below, but here is the piece that is drawing incorrectly.
top_menu_img = LoadImage("HudScreen_Top.png")
top_menu_sprite = CreateSprite(top_menu_img)
SetSpritePosition(top_menu_sprite, 0, 0)
Instead of drawing the HUD; this always draws the background tile image (Default_B_G.png). I tried just changing the image to a couple of others to see what happens and it does the same thing.
// Project: Tint
// Created: 2017-01-20
// show all errors
SetErrorMode(2)
SetClearColor(120,141,63)
// set window properties
SetWindowTitle( "Tint" )
v_screen_width = 750
v_screen_height = 1334
SetWindowSize( v_screen_width, v_screen_height, 0 )
// set display properties
SetVirtualResolution( v_screen_width, v_screen_height )
SetOrientationAllowed( 1, 1, 1, 1 )
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
bg_tile = LoadImage("Default_B_G.png")
tileArray as integer[225] // 15 * 15
for i = 0 to 225
tileArray[i] = CreateSprite(bg_tile)
next i
bottom_menu_img = LoadImage("HudScreen_Bottom.png")
bottom_menu_sprite = CreateSprite(bottom_menu_img)
SetSpritePosition(bottom_menu_sprite, 0, v_screen_height - GetSpriteHeight(bottom_menu_sprite))
// This is the image that does not display correctly
top_menu_img = LoadImage("HudScreen_Top.png")
top_menu_sprite = CreateSprite(top_menu_img)
SetSpritePosition(top_menu_sprite, 0, 0)
global last = 0
for y = 0 to 14
for x = 0 to 14
last = y * x
idx = (y * 15) + x
SetSpritePosition(tileArray[idx], GetSpriteWidth(tileArray[idx]) * x, GetSpriteHeight(tileArray[idx]) * y + 200)
next x
next y
do
spr_hit = GetSpriteHit(GetPointerX(), GetPointerY())
if spr_hit <> 0
SetSpriteVisible(spr_hit, 0)
endif
Sync()
loop