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 / Getimage give me a blured and smaller image than source..

Author
Message
Alain91
13
Years of Service
User Offline
Joined: 20th Aug 2011
Location: France
Posted: 21st Feb 2014 14:54
Hello AppGameKit!

I tried to create buttons using a background image and a text. (tier 1)

- I load an image and write text on it,
- render,
- get the button zone as an image,
- create sprite from this image.

I have a problem : when getimage capture my button, it is anti-aliased and smaller than the source..

I joined a basic example in this post.

Please could you help me to understand ?

Alain

Attachments

Login to view attachments
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 21st Feb 2014 15:27
It's strange, but you can force it to behave...



I changed the setup so it uses the same native resolution of 768x1024, and doing that made the sprite just a little smaller than the original. I also set the display aspect to exactly 768/1024 - or 0.75 instead of 0.66. So if you use the exact resolutions, it's still not the same size...

So the last thing I did, was set the sprite size which seems to get around the problem, and that might be the only thing you need to do, set the sprite size as the image might be fine, it might be the exact perfect resolution, but the sprite may just be scaled for some reason.

I'd actually suggest just having separate texts and buttons, rather than merging the 2 - AppGameKit is not too shabby at rendering text, I'd just make some nice button sprite animations, overlay the text, and you have a bit more freedom as you wouldn't need lots of unique grabbed button images. Plus - GETing an image is not ideal, you'll probably notice little artifacts on alpha transparent parts - best to avoid this I say, have dynamic buttons and separate text .

I am the one who knocks...
Marl
13
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 21st Feb 2014 15:36
Quote: "I changed the setup so it uses the same native resolution of 768x1024,"

Rather than mucking about with aspects and redefining the res in the app, I find it much easier to work to the native resolution using;

setVirtualResolution( getDeviceWidth(), getDeviceHeight())

In windows it uses whatever the setup file is set to. Change the setup and the app changes to match.
Alain91
13
Years of Service
User Offline
Joined: 20th Aug 2011
Location: France
Posted: 21st Feb 2014 15:42
Thanks for your suggestion.

I joined a picture where the "alias" is visible.

Too bad, I thought my way of designing buttons was good :/

Attachments

Login to view attachments
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 21st Feb 2014 16:58
Well there's nothing wrong with it, it's just a concern that if you need 20 buttons, then you'll have 20 buttons that don't do much. But if you have 20 buttons and 20 text objects, well those buttons can be animated for mouse overs, clicks, that sort of thing, and having the text and button separate makes it much easier. Thats all - the buttons look fine to me.

I am the one who knocks...

Login to post a reply

Server time is: 2024-11-25 02:42:06
Your offset time is: 2024-11-25 02:42:06