[Request] Tiled BG w/ image offset

0 favourites
  • 8 posts
From the Asset Store
Create your own wss server and ws server with ssl and without ssl.
  • In Construct Classic, Tiled Background Objects had a feature called "Image Offset". This allowed you to shift the image in any direction without affecting the size of the object itself. It was ideal for tilesets, infinitely scrolling backgrounds, infinitely scrolling overlays, and quite a few other things.

    I've tried to get this feature into C2's version multiple times but apparently it's very difficult to do with canvas2D (which no one should even be using) and Ashley won't release anything that's WebGL exclusive...except the whole pixel shader thing -w-;

    Anyway, I *need* this feature to create a tile-based level editor utilizing external files. It's also much, MUCH better than using hundreds if not thousands of sprite frames acting as tiles for obvious reasons.

    Is there anyone capable of & interested in creating an upgraded version of the Tiled BG object with this feature? If it's in the form of a shader I guess that'd work too.

  • Tiled bg may not be able to show specific quadrants of a texture, but it can do something sprite can't, that being having different textures for different instances, loaded by url.

    Imho that seems like a better option since you are not limited to a mapped tiled texture.

  • Hm. My goal here is to allow teammates to add any tileset/background to the game & update them on the fly without SVN and a C2 license. Splitting them up into hundreds of little tile files doesn't seem like the best option. A list object will be populated with the names of tilesets in a dev folder, and then I go from there, shrinking the Tiled BGs to tile size and offsetting to the selected tile.

    I'm open to other ideas but this seems the best to me.

  • Actually I've been thinking about making a tile editor, and one thing that you could do is use Rojo's Canvas plug to convert the textures into a string using Canvas.imageUrl.

    Then you could save that data to an 3d array x, and y as position and a nested token@ for the image string and other data such as size and angle.

    So in theory you could save every last bit of data into an array, and load that.

    Just one file.

  • Bump.

    newt PM'ed

  • The process is pretty straight forward. For the editor you make a grid of canvas instances, then drag and drop the textures you want onto those instances. When you are ready to save you do a for each on the canvas's, and paste the texture into the canvas, and then get the base64 string, and save that to either one big string with tokenAt(), or use an array.

    Then to load the textures, make a grid of tiled background instances, load the array, or string from the editor via the load array action, or from ajax.

    You would then parse the array, or sting, with a for each in array, or for n = token count of the string.

    Loading it from the string value as the load image from url action.

    The string from the editor would be huge however, and you would want to do some optimizations like only saving one texture once.

  • I see. I messed around with the canvas and sprite objects the other day.. Basically a resizable canvas can paste a tile or group from a single-image tileset, then load said image into a blank tile on the map. Worked pretty well but you could only paste as many images as there are animation frames and, as you said, those image URLs are massive.

    I'll try your way and see what I can come up with.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I just made a plugin that may be useful in this situation.

    http://www.scirra.com/forum/topic78654_post466046.html#466046

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