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] did the UV and image wrap commands change?

Author
Message
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Apr 2020 18:51
Here's an animated progress bar (macOS style) I did years ago. I just tried running it the snippet and it doesn't work anymore. In the loop where I set the sprite's UV offset, I had to change the V value from 1 to 0 to see the texture at all. And the image wrap doesn't seem to work anymore. It's not tiling on the sprite like it used to.

https://forum.thegamecreators.com/thread/216108

I'm not sure about my compiler version, but the IDE says 2019.09.27 (from steam)
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

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

Go to answer

Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 28th Apr 2020 19:23
This post has been marked by the post author as the answer.
Im not sure that this is the exact issue but the wrapping changed along time ago on release of version 2.0.20

Specifically:
Quote: "Using SetImageWrapU or SetImageWrapV with mode 1 (repeat) on an image that is not a power of two will now do nothing"


Your 20x12 image is not power of two

The SetImageWrapU/V functions also state the same:
SetImageWrap documentation wrote: "To use UV values outside 0-1 successfully on all platforms the image in question must be a power of 2 in width and height, and not be part of an atlas texture."



but, there is an easy fix that works in most cases, call these before loading the image:

SetDefaultWrapU(1)
SetDefaultWrapV(1)

Then it works again...at least on my pc it does and on the phone too.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Apr 2020 22:56
Ah thanks. I read power of 2 and thought multiple of 2. I wrote the code in 2015 and it apparently used to work back then. (otherwise I wouldn't have posted it). But your solution has resolved the problem.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Login to post a reply

Server time is: 2024-11-22 04:39:29
Your offset time is: 2024-11-22 04:39:29