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.

Newcomers AppGameKit Corner / Image Troubles

Author
Message
Koala
7
Years of Service
User Offline
Joined: 2nd Jan 2017
Location:
Posted: 2nd Jan 2017 03:04
Hello,
I'm having trouble trying to have the image I want in the game and this is the command I put:

LoadImage(1,"redball.jpg") <---prints out (Error: Could not find images: redball.jpg,redball.jpg in main.agc at line 26)

if GetImageExists(1)=1

endif

And I know you have to put in the media folder, however when I do that it still doesn't work. Someone please help me and the steps in how to do it.
-Thanks for reading this!
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 2nd Jan 2017 11:20
Welcome

File names ar case sensitive, make sure you use the exact name.
Is the file "bytecode.byc" also in your media folder? If not, you are looking in the wrong place.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
damothegreat
User Banned
Posted: 2nd Jan 2017 12:01
Does AppGameKit work with JPG files - I never knew that - well I haven't tried. I always thought they were PNG files

The way I call is:-

LoadImage(1,"\media\redball.jpg")

or
LoadImage(1,"media\redball.jpg")


If still an issue - then convert your JPGs to PNGs

Have fun with AppGameKit

Damo
Using Tier 1 AppGameKit V2
Started coding with AMOS
Anything is possible if put mind to it
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 2nd Jan 2017 15:52
If you want transparency then use PNGs.
If you want low-disk usage, use jpg with a little bit of compression (at the expense of quality).

Once loaded, they both take up exactly the same space in memory. So it's all about transparency, disk space and quality as to which you use.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Koala
7
Years of Service
User Offline
Joined: 2nd Jan 2017
Location:
Posted: 11th Jan 2017 07:07
I tried to follow both of your advice, however it still doesn't work. I honestly think I'm making a dumb mistake because it still says "error cannot find redball" (something like that)
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 11th Jan 2017 08:54
Quote: "Is the file "bytecode.byc" also in your media folder? If not, you are looking in the wrong place."


It would also help if you showed us more of the code around the problem.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 11th Jan 2017 22:15
redball = CreateSprite(LoadImage('redball.jpg'))

Attachments

Login to view attachments
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 12th Jan 2017 10:09 Edited at: 12th Jan 2017 10:11
The project compiled fine here, and an image of a red ball showed up when the app was running. What platform are you running AGK2 on? Linux filesystem is case sensitive, and it seems to be optional on Mac whether or not to have a case sensitive filesystem, Windows is not case-sensitive.

EDIT: It does not seem like a case sensitive problem, in the code "redball.jpg" is all lower case, as is the "redball.jpg" filename.
13/0
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 12th Jan 2017 12:26
Cybermind, Windows.
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 13th Jan 2017 09:10
@Qugurun, and now I see that you are not original poster, DOH :-P I thought you were OP showing some code :-P
13/0

Login to post a reply

Server time is: 2024-04-19 04:18:37
Your offset time is: 2024-04-19 04:18:37