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 / [SOLVED] How to paste images?

Author
Message
Brian Lancaster
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Oakland, CA
Posted: 17th Jan 2020 19:37 Edited at: 17th Jan 2020 19:47
I am a complete n00b who just transferred from DarkBasic Pro. Can someone tell me the command to paste an image, or does everything have to be a sprite? I want the static map tiles to be images and the dynamic objects, etc. to be sprites just to save on processing power. On DBP I never used sprites, just images.

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

Go to answer

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Jan 2020 21:44
If you want the image to be visible on the screen then it has to be a sprite. You can use DrawSprite() to draw the same sprite multiple times
Brian Lancaster
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Oakland, CA
Posted: 17th Jan 2020 21:57
Sweet. Had to make sure before I continue.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Jan 2020 23:02
Have a look at SetViewOffset(). Very handy for scrolling maps
Brian Lancaster
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Oakland, CA
Posted: 18th Jan 2020 00:02
Beautiful, thanks.
Brian Lancaster
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Oakland, CA
Posted: 19th Jan 2020 01:16 Edited at: 19th Jan 2020 01:18
Sorry, blink0k, another question. When I try to render a 500x500 tile map with 32x32 tiles, it runs at 10 fps. Am I missing something? Thanks for the help.

EDIT: I think I know the reason. Don't know how to delete a post, though.
Brian Lancaster
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Oakland, CA
Posted: 19th Jan 2020 01:22
OK, so I have a 500x500 tile map with only the upper left corner visible, and it's running at 22 fps. I'm thinking I might go back to DarkBASIC. I did the same kind of functions without sprites and it ran smoothly. Screenshot attached.

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Jan 2020 01:57
Quote: "I did the same kind of functions without sprites and it ran smoothly."


How do you mean "without sprites"?
Brian Lancaster
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Oakland, CA
Posted: 19th Jan 2020 02:07
Just the paste image command. It was so much simpler. I'll try to figure this out tomorrow because I give up for today. Thanks for the help, though.
Brian Lancaster
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Oakland, CA
Posted: 19th Jan 2020 02:17
Here's the code I have so far, but I'm 90% sure AppGameKit is too slow for what I want to do.

Attachments

Login to view attachments
Brian Lancaster
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Oakland, CA
Posted: 19th Jan 2020 03:16
This post has been marked by the post author as the answer.
Nevermind, I figured it out.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Jan 2020 03:45
I would be very interested to learn what your solution was
Brian Lancaster
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Oakland, CA
Posted: 19th Jan 2020 03:54
I forgot that I could just not draw sprites that are off-screen. Therefore, I don't think I'm gonna be using the SetViewOffset().

Anyway, I'm trying to emulate the scrapped steampunk game you can find here: https://blancaster45.itch.io/

(also check out my last project, I can give you a Steam key)
Brian Lancaster
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Oakland, CA
Posted: 19th Jan 2020 04:01 Edited at: 19th Jan 2020 04:18
Oh, btw, do you know where I can find the keyboard scancodes for GetRawKeyState?

EDIT: Nevermind, got it.
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire

Login to post a reply

Server time is: 2024-03-28 08:46:55
Your offset time is: 2024-03-28 08:46:55