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.

Windows / SetImageMask not working ?

Author
Message
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 29th Oct 2015 08:27

Hello , tell me why it is not working and how to fix it ?



But if you save the results, we can see that the mask works!



Help me!

Attachments

Login to view attachments
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 29th Oct 2015 10:26
If you set the size of the sprite "SetSpriteSize(coin, 0.832292,0.832292)" , artifacts appear as black lines, how to get rid?
Will it get rid of it if you work through a mask? Because if you use a PNG with transparency it turns out the same artifact.


Attachments

Login to view attachments
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th Oct 2015 01:06
"SetSpriteSize(coin, 0.832292,0.832292)"

Are you using virtual resolution or percentage?
Cheers,
Ancient Lady
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 31st Oct 2015 10:16


I know the size of the screen and the background (540.960) how many times the background more or less of the screen, and then customize the remaining images to this ratio. Sorry my en.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 2nd Nov 2015 01:35
The 'GetDeviceHeight' command returns an integer value and the 'GetSpriteHeight' returns float. I don't know of AGK2 automagically converts the integer value to float so that the resulting calculation is a float value. If it doesn't and does a straight integer division, you might be getting a value of zero.

Try outputting the resulting scale number and see what you get.

A suggestion, since you call the 'GetDeviceHeight' and 'GetDeviceWidth' commands more than once, try making one call and saving the results in a global variable and then use that variable. This reduces the overhead for using the command.

Also, instead of 'background = CreateSprite(LoadImage('images/background.png'))', try this:


While the example is small, you want to be able to clean up the loaded image in the end, usually. When you use the 'LoadImage' command directly in the 'CreateSprite' command, there is no automagic process that will clean up the loaded image.
Cheers,
Ancient Lady
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 16th Nov 2015 15:25
No, it does not work, will only nearest neighbor scaling of the image but I do not know how to implement it , even start with the simplest - get pixel color.

Login to post a reply

Server time is: 2024-04-19 05:23:13
Your offset time is: 2024-04-19 05:23:13