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] Draw Being Stretched

Author
Message
SignalOne
1
Years of Service
User Offline
Joined: 22nd Aug 2021
Location: Australia
Posted: 15th Feb 2022 04:58
Hi,
I'm new to AppGameKit and I'm trying to draw to an image which then gets converted into a sprite. However, the sprites are appearing stretched vertically.

As an example:



The ellipse is neither a perfect circle, nor is the size accurate to that specified (the rendered sprite is 35x61 pixels when taking a screenshot and measuring). SetDisplayAspect has no effect (as expected since SetVirtualResolution is used).

Can someone please help with what I'm missing?

Thanks.

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

Go to answer

Virtual Nomad
Moderator
16
Years of Service
Recently Online
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 15th Feb 2022 05:09 Edited at: 15th Feb 2022 05:20
This post has been marked by the post author as the answer.
i think you should make your render image the same aspect ratio as your virtual resolution. ie:



then, if you want the precise dimensions, i expect you'd need to make the render image the same size as the virtual dimensions.

otherwise, account for it by scaling the sprite while accepting the loss of quality.

meanwhile, moving this to agk newcomer chat for more exposure. 2d chat has become more of a place to share/discuss 2d media vs code talk.

finally, welcome aboard

Attachments

Login to view attachments
SignalOne
1
Years of Service
User Offline
Joined: 22nd Aug 2021
Location: Australia
Posted: 15th Feb 2022 05:38
Thanks for the answer and for the welcome, Virtual Nomad.

That looks like it was the issue. I'm not sure why the render image maps to the aspect ratio of the window like that, but perhaps I'm not using the function in the way it was intended/designed by using it to programmatically draw sprites. At least now that solves the problem.

Thanks

Login to post a reply

Server time is: 2022-10-03 02:07:02
Your offset time is: 2022-10-03 02:07:02