Hmm I already changed it, but I actually think I know the issue. What I did was
function loadImage(img){
var image = new image();
image.onload = function() {
return "whatever";
}
image.src = img;
and if I´m not mistaken the "return" on that place will not return the value where I need it to be returned. My b!
I tried it out recently and overall it looks pretty useful. Awesome.
One thing I noticed is that return values do not work if the returning is delayed, in my case I had to load an image onto a canvas, process some stuff and then return it. In order to properly load the image I had to wait for image.onload, the plugin didn´t wait and always returned 0. I worked around it by loading the image in a previous function, but it would be great if there was a trigger event like "on function 'functionCall' value returned" to allow this sort of things.
Running out of characters, lul.
What is left to do is to create something that parses the tilemap and generates an image based on it, that then can be shared. It´s a very raw prototype, but generally I´d say the idea is entirely possible.
In C2 there´s also the canvas plugin (from R0j0hound) that has this option to pick a color from the canvas and also draw to a canvas, makes things a little bit easier I guess but haven´t tested it.
Fun thing, one could even go ahead and load in random images to generate maps, though that would require a bit of tweaking so it isn´t completely unplayable. You could snap a picture of your cat and check out what level it generates.
I´ve been tinkering with this idea around a bit (in C3 tho)
First things first: You can prevent Twitter from compressing the image by uploading a png that contains transparency (even if it´s just 1 pixel that has 99% opacity)
Further what I did is to write a little js (with the javascript plugin) that loads the image into an offscreen canvas, then parses the individual pixels. Each pixel holds the information for 4 tiles (RGBA values), so an image with just 100x100 pixels would hold the information for a whopping 40.000 tiles (or a 200x200 tilemap)
Also since each RGBA value takes 0-254 this means there´s 255 possible different tiles (actually 254, since Alpha at 0 removes also the RGB values) OR one could use it to also store the 8 different tile configurations (flipped, rotated,....) for 31 different tiles.
Using rbga values is pretty neat, since tiles in construct are referenced by a number and we can directly use that number instead of having to use encryption.
Yeah I´m aware, I´ll stick to the stable releases if I do bigger stuff and probably use beta releases for tinkering. That stable releases will be "less frequently" is what I expected, I hoped for an estimate like "every 4-6 weeks" so I can sort of expect when juicy new features will drop into the stable version.
How often are stable releases to be expected? I kinda liked the constant flow of updates, despite beeing possibly unstable. Stability wise I haven´t encountered any crashes for quite some time now so that seems to be fine.
Member since 18 Feb, 2014
err ok 15 characters I hope I don´t make mistakes