tiled image on a sprite?

Get help using Construct 2

Post » Wed Feb 13, 2013 8:47 pm

I want to add a repeating image on a sprite. Ex: If a user draws a line, the line has a specific texture depending on a Boolean variable. (If it is true, use texture A. If false, use texture B).

I can't figure out how to attach a texture to a sprite. AND I can't figure out how to have a different texture depending on the variable. (If I can't use the variable - I can make extra sprites instead. But if I can use the variable, it would be cleaner coding :o)

Can somebody point me in the right direction? (I searched the tutorials and forums but can only find info on using a tiled image for the background).

TIA!


p.s. Just bought the personal version and it is well worth it for the "families" alone! :D

B
10
S
3
G
3
Posts: 29
Reputation: 2,692

Post » Wed Feb 13, 2013 8:54 pm

Put your textures in different animation frames of sprite. Then set correct frame at events based on your variable.
B
24
S
8
G
7
Posts: 756
Reputation: 7,202

Post » Thu Feb 14, 2013 4:37 pm

I tried that but the graphic/texture doesn't repeat.
I tried different things (using the animation as suggested, and pinning the tiled object to the sprite) and it either had one small instance that didn't repeat over width of object - or it stretched the small graphic over the entire width (not good either).

What am I doing wrong? How can I get the image to repeat over the sprite?
B
10
S
3
G
3
Posts: 29
Reputation: 2,692

Post » Thu Feb 14, 2013 4:59 pm

You should rather use the TiledBackground plugin which is dedicated to repeating textures.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Thu Feb 14, 2013 8:20 pm

ok, but that link shows the TiledBackground Behaviour which I already have on the sprite. Is there another "plugin" that you are referring too?
B
10
S
3
G
3
Posts: 29
Reputation: 2,692

Post » Thu Feb 14, 2013 8:27 pm

Found it. I had looked for a plug-in link on the site, and found it in the forum section. :o)
B
10
S
3
G
3
Posts: 29
Reputation: 2,692

Post » Thu Feb 14, 2013 8:43 pm

TiledBackground is a built-in plugin shipped with Construct 2.
The link above links to the manual entry of the PLUGIN, not of a behavior.

Have a thorough read through the whole manual before going further.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Thu Feb 14, 2013 9:00 pm

I have tried repeatedly with the built in TiledBackground object feature (sorry I wrongly referred to it as a behaviour) and have not had any success.

I appreciate the feedback. I have read the manual and run through the beginner tutorial (and several other tutorials, studied examples, and done lots of reading on the forums, etc.). I am simply not very good at this sort of thing, but I am trying (just struggling along the way!)

So, as a result of all that trying, I still have the problem of not being successful at adding a repeating textures to randomly drawn lines. I can get the texture graphic to display on the lines either stretched to fit, or simply one instance of the graphic to the correct scale - but sitting alone on a long line (not repeating).

Still experimenting/trying - no success so far.
B
10
S
3
G
3
Posts: 29
Reputation: 2,692

Post » Sun Feb 17, 2013 9:40 pm

I still haven't solved dthis
B
10
S
3
G
3
Posts: 29
Reputation: 2,692

Post » Sun Feb 17, 2013 10:05 pm

Maybe you can post a drawing or a capx, I'm not sure what you're trying to do here
B
20
S
5
G
8
Posts: 325
Reputation: 6,473

Next

Return to How do I....?

Who is online

Users browsing this forum: farfetchd83, mjj1990 and 3 guests