Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] Displaying a png file

Author
Message
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 2nd Mar 2019 09:11
Good morning. When I try to display a .png file it works fine but when I delete it the screen goes blank (white) and nothing else will display on the screen.
something like this.
loadimage(1,"picture.png")
createsprite(1)
sync
sleep(5000)
deleteimage(1)


Please help . thanks

The author of this post has marked a post as an answer.

Go to answer

Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 2nd Mar 2019 09:18
I want the screen to go back to it's original state. I'm obviously missing something.
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 2nd Mar 2019 09:38
loadimage(1,"themazegame.png")
createsprite(1)
sync()
sleep(5000)
deleteimage(1)


start:
level1:
deletetext(1)
deletetext(2)
deletetext(4)
deletetext(5)
deletetext(3)
deletetext(6)
deletetext(7)
deletetext(8)
createtext(1,"THE AWSOME MAZE GAME")
createtext(2,"USE WASD TO GUIDE YOU THROUGH THE MAZES")
createtext(3,"COLLECT AS MANY ORBS AS YOU CAN")
CreateText(4,"EACH ORB MUST BE COLLECTED IN 150 SECONDS")
createtext(5,"GOOD LUCK")
createtext(6,"COPYRIGHT 2019 PAUL FABER ALL RIGHTS RESERVED")
createtext(7,"K & L FULL SCREEN")
createtext(8,"PRESS RETURN TO START")
settextsize(1,40)
settextsize(2,40)
settextsize(3,40)
settextsize(4,40)
settextsize(5,40)
settextsize(6,20)
settextsize(7,40)
settextsize(8,40)

settextposition(1,500,200)
settextposition(2,350,250)
settextposition(3,405,300)
settextposition(4,355,350)
settextposition(5,600,400)
settextposition(6,50,740)
settextposition(7,548,450)
SetTextPosition(8,505,500)

sync()
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 2nd Mar 2019 09:40
After deleting the png file the screen goes white instead of the original black screen. I put the code in so you can take a look.
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 2nd Mar 2019 09:50
This post has been marked by the post author as the answer.
loadsprite(1,"themazegame.png")
setspriteposition(1,0,0)

sync()
sleep(5000)
deletesprite(1)
sync()

It's ok I figured it out in the end . the above code sorted it .
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 2nd Mar 2019 09:50
The sprite is defaulting to no image it sounds like, you need to delete the sprite as well.
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 2nd Mar 2019 09:52
Thanks for your time .

Login to post a reply

Server time is: 2024-11-05 23:17:21
Your offset time is: 2024-11-05 23:17:21