tiled image on a sprite?

0 favourites
  • 11 posts
From the Asset Store
Elevate your games with our AI Chatbot Integration! Seamlessly connect your Construct 3 projects with GPT-4 for dynamic,
  • 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

  • Put your textures in different animation frames of sprite. Then set correct frame at events based on your variable.

  • 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?

  • You should rather use the TiledBackground plugin which is dedicated to repeating textures.

  • ok, but that link shows the TiledBackground Behaviour which I already have on the sprite. Is there another "plugin" that you are referring too?

  • Found it. I had looked for a plug-in link on the site, and found it in the forum section. :o)

  • 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.

  • 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.

  • I still haven't solved dthis

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Maybe you can post a drawing or a capx, I'm not sure what you're trying to do here

  • Ok, I finally figured out how to use the TiledBackground to make a sprite with a recurring texture. But then I had an issue with the lack of Origin Points. But then I discovered the HotSpot property, and all is well with the world.

    Thanks for pointing me in the right direction. I'm slow at this stuff. But I'm getting better!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)