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 / [SOLVED] GetImage() not working properly on Windows 7

Author
Message
Bubba
Reviewed AGK on Steam
13
Years of Service
User Offline
Joined: 10th Jul 2005
Location: California, US
Posted: 22nd Nov 2018 11:28 Edited at: 22nd Nov 2018 22:11
FIXED IT, Thanks 'TomToad'


In this program I make a square Sprite, I rotate it 45 degrees , and then I try to get the top half of the image in order to make a triangle sprite.
However, the Sprite turns out looking like the original diamond shaped sprite.
I just want to get the top half of the 'diamond' in order to make a 'triangle sprite'. Instead, it gets the entire diamond shape and I end up with a second 'diamond shaped' sprite.



So, maybe what is happening here is..... the 'GetImage() command only gets a 'square' image, and does not get 'rectangle' images.
It gets a 'square' image based on the width of the image, even though a different height is specified.

However, working on this thesis, I still could not get this program to work properly.

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

Go to answer

TomToad
1
Years of Service
User Offline
Joined: 6th Jan 2018
Location:
Posted: 22nd Nov 2018 13:22
This post has been marked by the post author as the answer.
The problem is that the parameters of GetImage are x,y,width,height. So with the parameters that you are using, you are grabbing the entire sprite instead of the part you want.
change
GetImage(2,460,238,740,379)

to
GetImage(2,460,238,280,141)

And it will work like you expect.

Login to post a reply

Server time is: 2019-04-23 19:59:26
Your offset time is: 2019-04-23 19:59:26