mrtumbles's Forum Posts

  • I don't know about a plugin, but it's easy enough to do by just checking for overlaps. Do you want your objects to shuffle left, right, up, down, or just towards the centre? Either way, use detect overlap at offset in the direction you want everything to move. If it doesn't overlap another object, move it. Shouldn't be more than a line or two - I've used this for simple inventory management stuff before - provided you're not doing it on thousands of objects at once in tiny increments you should be alright.

  • That 0 by where the cursor is in your screenshot has quote marks around it, but not & symbols which would cause it to be read as a string.

  • Do you mean you want to set the tilemap's tilesheet image from any other image? If you have the URL of that image (ie: if it's a project file, or a file hosted and accessible from elsewhere) you can use the 'Load image from URL' action on the Tilemap.

    Do you mean you want to be able to import an image at runtime and draw the tile with one pixel per tile? In which case you need to load the image into a sprite, draw the sprite at [0,0], then run a 2D loop that will check every cell in your array. For example:

    For "x" from 0 to ( Tilemap.Width / Tilemap.Tilewidth )
    For "y" from 0 to ( Tilemap.Width / Tilemap.Tilewidth )
    [/code:2rszhbpz]
    
    Gives you a loop which iterates over every cell in the tilemap. You'll need a way of indexing the tiles to pixel colours, but the pixel colour can be determined using this lovely line from @R0J0hound:
    
    [code:2rszhbpz]
    Browser.ExecJS("var canvas=document.getElementById('c2canvas');
    var ctx=canvas.getContext('2d');
    var pixel=ctx.getImageData("&loopindex( "x" )&","&loopindex( "y" )&",1,1);
    pixel.data[0];")[/code:2rszhbpz]
  • Just to holler back; the above example from korbaach is exactly what was necessary to allow me to style my sliders (and anything else in the page that was being a bit awkward) without using plugins. Several testing phases (so a good few hundred runs) in and it still hasn't once failed to correctly style my widgets. Very happy.

    Many moons of happiness upon korbaach

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • you can write this function in Browser: Execute Javascript

    not best way..but anyway... just for fun..

    Browser_Import_CSS.capx

    Just what I was looking for! I'll get down to it now...

  • You see, this is my first project and I don't remember why, but I've set the window size to 5750, 3250 when created the project. Also, one of my layouts is 31546, 3250.. And there's no way I can change that now..

    Is this the source of this big data size?

    Almost definitely. If your assets are also very big (which is quite likely given the screen size etc) then their images will be very large in terms of MB.

  • The first relies heavily on extensive use of plugins (which is incompatible with the goals of this project), the second doesn't work for slider-bars Thanks though! I've managed to get the rail to style using "webkit-appearance: none" but that's all so far.

  • Hey all! I'm working on an editor for game content, and have managed to make a nice-looking UI using the in-built form elements, styled with CSS - but I can't get sliders to style at all! They respond to css in weird ways, for example, changing the border-radius seems to simply extend and slightly the rail of the slider.

    Anyone had any success styling their sliders with CSS?

  • My only grumble here is that the freeze happens so often when the marquee tool isn't selected - but I have now at least learnt that the marquee tool pretty much guarantees it. Thanks guys

  • Ashley - being very familiar with this bug, any image will do. Or not. An image will upload successfully one moment, then not the other. The likelihood of the image being an issue is, having observed this error for a long time, 0. I could upload some images to make you happy, but all of them would as likely upload succesfully on my system as they would crash C2, so I don't much see the point.

    You also don't get access to any settings options. It hangs before getting to the dialog where you input the spritesheet cell dimensions. I have observed occasions where the hang has solved itself after a few minutes and I am shown the dialog where cell dimensions may be entered - although these have been rare. More often than not I give it two minutes, then force-close and re-open C2.

  • I can't *intentionally* reproduce this bug as it seems to happen entirely at random, but has often happened in the past, and is happening on my current project all the time as I'm making heavy use of the sprite-sheet importer. Ashley : I've found this bug reported several times now, and always dismissed because it could not be reproduced - when it has in fact been reproduced by many users. Could it please be investigated?

    I'm jamming at present and manually slicing up all my sprite-sheets is really cramping my time-frames - but it's necessary as it takes less time than the 'force close ten times in a row restart and cross my fingers for attempt 11' importing method. I know a fix won't come by the jam end or anything but it'd be nice to have this problem looked at before the next one!

  • brent_hamel

    This shader is for sprite; to rotate transform skew and much more .. still wip ..

    http://gigatron3k.free.fr/html5/C2/FX/sutility/

    Love this plugin, and really want to get it working on sprites - is there anywhere to download it? I hope so! <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

  • Congratulations! To check diagonally you'll need to add to that 'OR' condition (I didn't realise diagonals counted in gomoku!). You see how it currently checks at X/Y +/-1, like so:

    Array.At( Array.CurX - 1 , Array.CurY )&Array.At( Array.CurX  , Array.CurY )&Array.At( Array.CurX + 1 , Array.CurY ) = "yellowyellowyellow"[/code:162de7n3]
    
    Note these lines check orthogonally. For example, X-1, X, X+1 describes a horizontal line. You'll have to add new checks to the OR expression which describe diagonal lines. Here's a starter, a diagonal line running top-left to bottom-right:
    
    [code:162de7n3]Array.At( Array.CurX - 1 , Array.CurY - 1 )&Array.At( Array.CurX  , Array.CurY )&Array.At( Array.CurX + 1 , Array.CurY + 1 ) = "yellowyellowyellow"[/code:162de7n3]
  • Is that a 9-Patch?

  • Add a condition to the action in which troops are purchased which checks to see if the player has enough points. If the points are stored as a variable, they can be compared using System > Compare variable. If they are stored on an object's variable, you will have to use Object > Compare variable.

    Make sure it checks if their points are greater than OR equal to the cost!

    Good luck - if you have any problems make sure to post your capx - it makes it a lot easier to see what you mean and how to fix it