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.

Author
Message
edler
6
Years of Service
User Offline
Joined: 11th Jan 2018
Location:
Posted: 15th Apr 2018 10:26
In the help code example of https://www.appgamekit.com/documentation/Reference/Image/SetImageWrapU.htm



Changing setimagewrap options there is not changes on the image.
Is a bug of setimagewrap?
--
edler

AppGameKit forum in Spanish, yet!
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 15th Apr 2018 19:30 Edited at: 15th Apr 2018 19:40
looks like just a bad example to show on phone as the created images are not power of 2 so you can't use the wrap functions (should work fine on PC though).
try this one
life's one big game
spec= 4ghz, 16gb ram, AMD R9 2700 gpu
Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 15th Apr 2018 20:13 Edited at: 15th Apr 2018 20:21
I dont see a problem with the example code and it works fine on 2 of my pc's. Without turning on the wrapping you get a clamped image with only 1 circle where as turning it on gives you multiple circles as expected.

It creates images 64 x 64 pixels which ARE a power of 2.

If you add these lines then the example works on mobile too
SetDefaultWrapU(1)
SetDefaultWrapV(1)
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 15th Apr 2018 20:38
there isn't strictly anything wrong with the code it just doesn't create 64x64 images on some phones because the GetImage command isn't an exact size - it even states it in the help file.
Quote: "Note that the image produced by GetImage() is not guaranteed to have the same width and height as those given to the command, this is because the image is created from a portion of the screen which has a different size on different devices"
life's one big game
spec= 4ghz, 16gb ram, AMD R9 2700 gpu
Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 15th Apr 2018 21:20 Edited at: 15th Apr 2018 21:21
Of course, Its grabbing a proportion of the virtual resolution so wont map necessarily 1 "virtual pixel" width to one "actual pixel" in the backbuffer. Only if the virtual width and height is the same as the actual device width and height will you get what you ask for. I get what you meant.

What I was trying to say is that doesnt always matter though as the image will still wrap on many devices with none power of 2 pixels by by using the default commands.



On my phone the image is 67x67..on tablet its 50x50 and the wrapping functions still work ok.

Its the addition of these that seems to sort it
SetDefaultWrapU(1)
SetDefaultWrapV(1)
edler
6
Years of Service
User Offline
Joined: 11th Jan 2018
Location:
Posted: 16th Apr 2018 09:30 Edited at: 16th Apr 2018 10:54
yes, the help code its a bad example. Now i understand the command so. thanks!!
--
edler

AppGameKit forum in Spanish, yet!

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-23 01:23:05
Your offset time is: 2024-11-23 01:23:05