I need an object to be tiled AND have multiple animations.

0 favourites
  • 3 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • Hi all, time again for me to ask for the "impossible".

    I use Sprite Animations as "Theme" for my game.. it's simple to have a global variable and easily change the whole UI by setting all sprite animations to the corresponding theme.

    However, one of the UI objects needs to be tiled.

    Approach 1:

    Use a TiledBackground and "Load image from URI"

    Problem: I wish to store the images in a prepared sprite like - "Load from URI(Sprite.CurrentImageAsURI)"

    Approach 2:

    Use a Sprite and trick it to tile the image instead of stretching it.

    Problem: Option does not seem to exist.

    There are probably other nice ways to change theme functionality, by using families or arrays, but I really like the stucture with animations.

    Thanks for your time.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Problem: I wish to store the images in a prepared sprite like - "Load from URI(Sprite.CurrentImageAsURI)"

    Why'd you like to store it in a prepared sprite? Is there a reason you cannot use an ajax request to load the image? If you only want to load the image once, you can store it inside a binary data object and load it from there.

    And for changing a variable to change the theme, that's also possible with this approach. You can request a URL with ajax rather than a file, that you can point to the local resources by string and just add the global variable in the name. So you'd request "stringsub("./tiledfile{0}.png", globalVar)

    This would request e.g. tiledfile1.png or tiledfile2.png or tiledfileVolcanotheme.png, etc.

    I wouldn't attempt approach 2.

  • > Problem: I wish to store the images in a prepared sprite like - "Load from URI(Sprite.CurrentImageAsURI)"

    Why'd you like to store it in a prepared sprite? Is there a reason you cannot use an ajax request to load the image? If you only want to load the image once, you can store it inside a binary data object and load it from there.

    And for changing a variable to change the theme, that's also possible with this approach. You can request a URL with ajax rather than a file, that you can point to the local resources by string and just add the global variable in the name. So you'd request "stringsub("./tiledfile{0}.png", globalVar)

    This would request e.g. tiledfile1.png or tiledfile2.png or tiledfileVolcanotheme.png, etc.

    I wouldn't attempt approach 2.

    This is great!

    Nice touch with the new stringsub.

    Thanx for the help!

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