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 / this is a bug?

Author
Message
pamercomov
FPSC Reloaded TGC Backer
9
Years of Service
User Offline
Joined: 2nd Jan 2015
Location: palma de mallorca
Posted: 27th Dec 2015 07:05
hi.
when I create a sprite so:

createsprite(1,monta)

this comand no works fine

SetImageWrapU(1, 1)
SetImageWrapv(1, 1)

but if I do so

c=createsprite(monta)
SetImageWrapU(c, 1)
SetImageWrapv(c, 1)

if it does.

I thought it was like creating a sprite of two ways, but I see not, and if it's a bug or really should be.
and if so more differences like these there?
using AppGameKit V2 tier 1
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 27th Dec 2015 07:55 Edited at: 27th Dec 2015 08:43
Without seeing the rest of your code (or at least enough to test) it's hard to say what's going on.

Try this...



You'll see that both sprites uv wrap correctly.

Can you post an example of how yours doesn't work?

EDIT: Oh! I see what you are doing. You are setting the image wrap behavior on the sprite ID, not the image ID. So it should be

SetImageWrapv(monta, 1)

LOL, that was an easy catch that I completely missed the first time around!

BraindeaD caught it though.

Attachments

Login to view attachments
BraindeaD
16
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 27th Dec 2015 08:00
Hi Pamercomov!

I'm not sure, but maybe the problem is that SetImageWrapU is related to Images instead sprites... not sure why in the second piece of code it works...

Regards
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 27th Dec 2015 08:15 Edited at: 27th Dec 2015 08:45
@BraindeaD - Setting the image wrap tells AppGameKit what to do when the image uv's are not the default.

I could have used SetSpriteUVScale(MySprite,.3333,.3333) to get the same result, but you still have to tell AppGameKit how to handle the image assigned to the sprite, either to clamp or repeat it.

EDIT: However, you may notice that I used the same image for both sprites in my example. A better example would be to use two separate images. If you change the uv wrap on an image multiple times, only the last change applies when the image is used.

At least I think that's how it works.

I'll change the example to better reflect this. Good catch on the "image vs sprite" behavior!
pamercomov
FPSC Reloaded TGC Backer
9
Years of Service
User Offline
Joined: 2nd Jan 2015
Location: palma de mallorca
Posted: 27th Dec 2015 16:11
hi...

i dont use this in this way

i use this

this dont work
and this work


upload 2 images
1 to test code "fondo.png"
1 to see error
using AppGameKit V2 tier 1

Attachments

Login to view attachments
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 27th Dec 2015 16:30 Edited at: 27th Dec 2015 16:30
this
back=loadimage("fondo.png")
fondo=createsprite (back)
SetimageWrapU(fondo, 1)

should be this

back=loadimage("fondo.png")
fondo=createsprite (back)
SetimageWrapU(back, 1) <image not sprite
AGK (Steam) V2.0.16 : Windows 10 Pro 64 Bit : AMD (15.30.1025) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Scary Little Rabbit
15
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 27th Dec 2015 16:39
again, just as it was said above you do it wrong. don't pass any sprite's index to setImageWrapU() because it needs an image's one.

by the way createSprite() returns indexes starting at 100001 and so it sets your fondo variable to 100001. then since there is no image with index 100001 all is tending to go crazy.
error #1:
'too many stars, too many stares. disembody.'
WIP: MIND!! free fonts for your AGKs
pamercomov
FPSC Reloaded TGC Backer
9
Years of Service
User Offline
Joined: 2nd Jan 2015
Location: palma de mallorca
Posted: 27th Dec 2015 17:08
oooookkkki

thx
using AppGameKit V2 tier 1

Login to post a reply

Server time is: 2024-09-29 09:16:42
Your offset time is: 2024-09-29 09:16:42