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.

DarkBASIC Discussion / Need Help With Loading A Sprite

Author
Message
Dr Eggman
9
Years of Service
User Offline
Joined: 27th Dec 2014
Location: In The Space Coloney Ark
Posted: 19th Mar 2015 02:52 Edited at: 19th Mar 2015 23:32
Greetings, It is I, Dr. Ivo Eggman.

I'm Having Trouble loading A Sprite I Made,
These are the Commands I am Using



I'm Not Sure If I am Using the Right Commands,
Or using them in the Right way,

Does my Sprite's File Need to be in "BMP" Format?
When I run my program I get the Error Message:

Runtime Error At Line 3, File Does Not Exist

I'm Not Sure what I'm doing wrong, I have Looked At
The Sprite Examples In Dark Basic and couldn't Find
Anything I'm Missing,

The Sprite Is In the Right Folder for Dark Basic to Find,
Though It works when I load My Sprite as An Image
Using These Commands:



But Does It Need to be loaded as A Sprite to Be able to Move it
in-game?

Any Help Would Be Much Appreciated
Thank you.



EDIT: Wait A Minute... Oops, I think I just got mixed up there...
Sorry.. Well Never mind the Question..

Though Is there a command to Move an Image?
Because I have Looked and I cannot Find One..

Thank you.

Ill Be Back, With a New Robot!
That has Super Laser Eyes,
And He'll Feed me Ham! Evil Ham..
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 20th Mar 2015 22:42
Quote: "Though Is there a command to Move an Image?"


Sprites are typically used for that. You simply change the location on the screen and it places the sprite accordingly. You can also use PASTE IMAGE and just change the coordinates on the screen where you want to paste it. There are no MOVE IMAGE or MOVE SPRITE commands in DBC.

So many games to code.....so little time.
Dr Eggman
9
Years of Service
User Offline
Joined: 27th Dec 2014
Location: In The Space Coloney Ark
Posted: 20th Mar 2015 23:12
Okay Thanks,

I'll Try That..

Ill Be Back, With a New Robot!
That has Super Laser Eyes,
And He'll Feed me Ham! Evil Ham..
Dr Eggman
9
Years of Service
User Offline
Joined: 27th Dec 2014
Location: In The Space Coloney Ark
Posted: 23rd Mar 2015 02:22
Hey, What File Type do Images have to be to be Loaded in Dark Basic?

Does PNG Work? Because for some reason I cant Seem to load Any Images
Into Dark Basic..

Thank you.

Ill Be Back, With a New Robot!
That has Super Laser Eyes,
And He'll Feed me Ham! Evil Ham..
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 23rd Mar 2015 03:26
You can load .bmp or .png files into DBC. So, to answer your second question, yes.

Typically when image files won't load, they are not in the correct folder, and DBC can't 'find' them. Be sure the image file is in the same folder as your main program if you have not given it the path to the file.


It is possible to locate them in a different folder, but If you do, you must provide a link to it within your call to load it. For example (if you have it in a folder named 'media':





It is possible that the image file is corrupt, but this is unlikely.

So many games to code.....so little time.
Dr Eggman
9
Years of Service
User Offline
Joined: 27th Dec 2014
Location: In The Space Coloney Ark
Posted: 23rd Mar 2015 06:54
I'll try that and see if it works,

Thank you

Ill Be Back, With a New Robot!
That has Super Laser Eyes,
And He'll Feed me Ham! Evil Ham..

Login to post a reply

Server time is: 2024-04-16 20:50:08
Your offset time is: 2024-04-16 20:50:08