It was useful to read the article about image formats. From now on, I will be using PNG's - they are even smaller than JPG's and quality loss-less
I called function "CLS" to clear screen after loading images and now everything works how it should. Dunno why it is not required after loading that image second time in my function...
function LoadImages()
set dir "Sprites"+str$(supportedRessolution(currentRessolution).x)+"x"+str$(supportedRessolution(currentRessolution).y)+"\"
//Images
loadImage("Loading", IMG_LOADING)
paste image 1,0,0
Text 200,600,"Loading Images"
sync
sync
loadImage("MainMenuRight", IMG_MAIN_MENU_RIGHT)
loadImage("SelectCharacter", IMG_SELECT_CHARACTER)
loadImage("Options", IMG_OPTIONS)
loadImage("ExitGame", IMG_EXIT_GAME)
loadImage("ButtonSelectCharacter", IMG_BUTTON_SELECT_CHARACTER)
loadImage("ButtonOptions", IMG_BUTTON_OPTIONS)
loadImage("ButtonExitGame", IMG_BUTTON_EXIT_GAME)
loadImage("ButtonPrevious", IMG_BUTTON_PREVIOUS)
loadImage("ButtonNewCharacter", IMG_BUTTON_NEW_CHARACTER)
loadImage("ButtonStart", IMG_BUTTON_START)
loadImage("ButtonNext", IMG_BUTTON_NEXT)
loadImage("ButtonYes", IMG_BUTTON_YES)
loadImage("ButtonNo", IMG_BUTTON_NO)
cls
//Bitmaps
paste image 1,0,0
Text 200,600,"Loading Bitmaps"
sync
load bitmap "MainMenu.png", BMP_MAIN_MENU
set dir ".."
endfunction
And a little function to avoid runtime errors while loading images:
function LoadImage(img as string, i as integer)
img=img+".png"
if file exist(img)
load image img, i
else
text 200,200, "Loading image "+img+" failed: file doesn't exist"
sync
wait key
endif
endfunction
Thx for help guys, it really helped to fix and improve my code
Join The dark Side! We have cookies