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 / "Broken Image" when I run code?

Author
Message
Wolfsong73
User Offline
Joined: 22nd Aug 2020
Playing: FFXIV, Fall Guys, Redout
Posted: 22nd Mar 2021 01:20 Edited at: 22nd Mar 2021 02:03
Hi all,

So, I'm following the video tutorials here for AGK.
I'm using a ship that's included with the final product of a space shooter the video series ultimately goes into.

Problem is, when I run the code, the image file shows up broken (checkerboard with a red x). I have the image in the same folder as the source file, I'm calling it by the correct filename.

Here's the code copy/pasted from the file:


I've attached the image file (I shrunk it down so it wasn't so huge, but the problem occurred before I did so, too).
I thought maybe there's an issue with the image file, so I created a new one, just a bright green circle, and saved it as PNG. Same problem. I've uploaded that, too, along with a screenpic of what I'm getting when I run the program.

I thought maybe it was a bitdepth thing, like I have to set 32bit to handle transparency, but couldn't find anything about that.

Can someone point out why that's happening?

Thanks!

Attachments

Login to view attachments
Virtual Nomad
Moderator
15
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 22nd Mar 2021 02:04 Edited at: 22nd Mar 2021 02:07
Quote: "I have the image in the same folder as the source file"

that "broken image" image generally means AppGameKit can't find the file. make sure "player.png" is in the project's media folder (and confirm the cases match).

IE, the source would be in the "root" folder, so the image needs to be in C:/.../MyProject/media, for example.
[My Itch.io Home] [Now Playing]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]
Wolfsong73
User Offline
Joined: 22nd Aug 2020
Playing: FFXIV, Fall Guys, Redout
Posted: 22nd Mar 2021 02:24 Edited at: 22nd Mar 2021 02:25
Ahhhh... Okay. I didn't know about the media path thing. That would explain it!

If it was mentioned in the video, I completely missed it.

Thanks!
Virtual Nomad
Moderator
15
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 22nd Mar 2021 03:35
sometimes it pays to read the top comments on YT
[My Itch.io Home] [Now Playing]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]

Login to post a reply

Server time is: 2021-04-14 08:08:45
Your offset time is: 2021-04-14 08:08:45