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 / How to create and render sprites on a RenderImage larger than the display?

Author
Message
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 6th Sep 2017 03:56 Edited at: 6th Sep 2017 15:16
Disregard... I got it sorted now.

Not sure exactly what I did to fix it because I very quickly went through numerous iterations changing this thing... test, change that thing... test. But now it all looks like it makes sense and it works so that is good. lol




Hey all,

NOTE: I am actually using DrawSprite to paste the images onto the renderimage.

I am sure this has to be something simple but I have not been able to do it yet. I find the whole virtual resolution thing part of the confusion. Not really sure what the purpose of that is. All of my game projects up til this point I just set it to the same size as the window/screen and don't give it another thought.

Anyway... I am trying to create a renderimage that is wider and taller than the screen (as in the display window)
However, when I render to it only the area that fits within the size of the screen has been drawn on.

I tried setting the VirtualResolution to the size of the renderimage immediately after using SetRenderToImage but that just caused another problem making the imagery very scaled down. Like I said though I really don't get what the virtual resolution is doing or why it is needed unless targeting multiple devices with different display sizes or something like that.

I also used SetScissor(0,0,0,0) after SetRenderToImage() and that did not fix it either. The drawing still is clipped on the render image.

Can anyone knock out some sample code showing how to Create a window 1000w x 720h and then create a render image 1024w x 288h (which I think will be created as 1024x1024 in reality).

Like I said maybe it is other things causing the issue. For example internally (my code) I am working with this as a 200w x 144h display and I use SetViewZoom(5) which automatically scales the sprites up by 5 x to fill the 1000w x 720h display window.

I am trying to create a 1024x288h renderimage and then displaying that in a sprite on the window scrolling it to the left and as soon as the sprite scrolls to the left there is no image data on the right side. It is just blank.

You can use this to see what I am working with and as a starting point. In reality, you are working with a 200 x 144 display area and this is automatically scaled up to fill the 1000 x 720 display.
I don't care if you fill the render image with color rects etc as long as it will work exactly the same for me using DrawSprite.

TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)

Login to post a reply

Server time is: 2024-09-30 07:12:20
Your offset time is: 2024-09-30 07:12:20