Outlining Block(s)

DavidsChannelDavidsChannel Member Posts: 44
edited July 2013 in Working with GS (Mac)
How can I make a 20x20px block with a 1px outline all around it? (the art isn't important)

And when I put two blocks next to each other the outlines should connect, and there should be one big outline around the two blocks (should work with more blocks and pretty much every shape). A project file would be much appreciated. Thanks! :D

Comments

  • WingmanappsWingmanapps Member Posts: 458
    edited July 2013
    How can I make a 20x20px block with a 1px outline all around it? (the art isn't important)
    You draw it!!!
    Paint, gimp, inkscape, photoshop (powerpoint 8-} ) what ever application you want to use

    And when I put two blocks next to each other the outlines should connect, and there should be one big outline around the two blocks (should work with more blocks and pretty much every shape). A project file would be much appreciated. Thanks! :D
    Just drag them into the scene and see if the outline match?

    I dont really get the question here and why you want a projectfile??????
  • DavidsChannelDavidsChannel Member Posts: 44
    How can I make a 20x20px block with a 1px outline all around it? (the art isn't important)
    You draw it!!!
    Paint, gimp, inkscape, photoshop (powerpoint 8-} ) what ever application you want to use

    And when I put two blocks next to each other the outlines should connect, and there should be one big outline around the two blocks (should work with more blocks and pretty much every shape). A project file would be much appreciated. Thanks! :D
    Just drag them into the scene and see if the outline match?

    I dont really get the question here and why you want a projectfile??????
    No, I don't want to draw it every time. I will have like 200 levels and all are based on a block basis. I just want to drag in the blocks and the outlines will spawn completely automatically!
  • BoomshackBarryBoomshackBarry Member Posts: 712
    I understand the problem, it sounds tricky. You'd probably have to pre draw versions of the blocks with various combinations of edges highlighted, so 4 blocks with the top, bottom, left and right highlighted individually, then four to act as corners, (top left, top right, bottom left and bottom right hightlighted). That should give you enough highlighted edges to create any shape you'd want from the blocks.

    But then you'd need to check all of the blocks dynamically to assess which ones are the outer blocks that form the shape, and change their graphics accordingly.

    It sounds like a logistical headache. I suspect tables would help a lot, similarly to building a Tetris game, but it's making my head hurt to think about it. Good luck!
  • WingmanappsWingmanapps Member Posts: 458
    edited July 2013
    thats a very vague description. you will need to draw something since gamesalad cant draw, atleast not what you want. You could spawn the outlines but I really dont see the benefit of doing that. You would still have to initially have to draw them before importing them into gamesalad

    Are you thinking of a grid? rather then outlines?
  • DavidsChannelDavidsChannel Member Posts: 44
    I understand the problem, it sounds tricky. You'd probably have to pre draw versions of the blocks with various combinations of edges highlighted, so 4 blocks with the top, bottom, left and right highlighted individually, then four to act as corners, (top left, top right, bottom left and bottom right hightlighted). That should give you enough highlighted edges to create any shape you'd want from the blocks.

    But then you'd need to check all of the blocks dynamically to assess which ones are the outer blocks that form the shape, and change their graphics accordingly.

    It sounds like a logistical headache. I suspect tables would help a lot, similarly to building a Tetris game, but it's making my head hurt to think about it. Good luck!
    Yeah it's pretty tricky, and I had a few sleepless nights thinking about this problem. I came up with one idea though: My outlines are basicly 20px wide and 1px high, but now made the image 20px wide and 2px high. So basicly the spawning blocks spawn outlines all around them and since they are 2px high, they kinda go out of the block. Basicly, when an outline detects another outline touching it, it knows that there MUST be another spawning block. So: When outline overlaps or colides with outline, destroy. I though that MUST work, but I ran across a glitchy behavior that offsets the outlines one or 2 pixels. I'm spawning the outlines relative to the actor, but they are at different positions every time. I'm trying to think about another way of doing it, maybe not that glitchy.

  • DavidsChannelDavidsChannel Member Posts: 44
    thats a very vague description. you will need to draw something since gamesalad cant draw, atleast not what you want. You could spawn the outlines but I really dont see the benefit of doing that. You would still have to initially have to draw them before importing them into gamesalad

    Are you thinking of a grid? rather then outlines?
    Well it's basicly an outline around one block (red lines with animation).
  • WingmanappsWingmanapps Member Posts: 458
    edited July 2013
    It sound like you are overcomplicating things - Why do you need to spawn the outlines.
    why not just draw them on your blocks before importing them in GS
    If block overlaps with block = destroy!!


    I think you need to provide some images/video of what you're trying it do before I can help any further
  • DavidsChannelDavidsChannel Member Posts: 44
    It sound like you are overcomplicating things - Why do you need to spawn the outlines.
    why not just draw them on your blocks before importing them in GS
    If block overlaps with block = destroy!!


    I think you need to provide some images/video of what you're trying it do before I can help any further
    So, I want to draw outlines because they look cool. And my app also has a level creator, where people can create their own levels. Basicly there is a block, that allows the player to spawn a ball in. I want that block to have an outline but the spawning block itself should be invisible. In the level editor they just place down the spawning blocks and the outline should be created automaticly.

    And yes, I do have pictures of the outlines imported (one side). They just need to be spawned in correctly. I need good expression that spawn and position the outlines correctly.

  • WingmanappsWingmanapps Member Posts: 458
    edited July 2013
    Still cant imagine what you are trying to achieve! need pictures dude
  • WingmanappsWingmanapps Member Posts: 458
    otherwise upload the project and ill take a quick look at it
  • WingmanappsWingmanapps Member Posts: 458
    image http://i39.tinypic.com/dvo6d5.png

    Any of these boxes similar - still dont get why not just draw the red line!!
  • DavidsChannelDavidsChannel Member Posts: 44
    image http://i39.tinypic.com/dvo6d5.png

    Any of these boxes similar - still dont get why not just draw the red line!!
    Well, sort of. Mine just have sharp edges. You're right, I could just draw this, but how I said, one spawning block isn't enough. I want to be able to just drag in the spawning blocks (without the outline) and there is a script which will spawn in the outlines around all of the blocks. So let's say I take some spawning blocks and lay down the lettter "L". The script should automaticly calculate the outline and put it around the whole thing. Or when I do 2 blocks next to each other like this: [][] I want the game to automaticly put an outline around the WHOLE thing. So the outlines of adjacent blocks connect with each other, creating one, big outline around all of the touching blocks. Got it now?
  • SocksSocks London, UK.Member Posts: 12,822
    @DavidsChannel

    This is fairly straightforward to do, you just need to make sure when a new block is spawned that another block - with a slightly wider boarder - is spawned underneath it.

    These background blocks - as a collective group - must alway be behind the foreground blocks.

    I could do you a quick project showing you the theory if you want . . .
  • BoomshackBarryBoomshackBarry Member Posts: 712
    And just like that @Socks knocks it out of the park! Awesome thinking Socks, it seems simple when you know the answer. Way to think outside the 'blocks'...

    See what I did there :)
  • SocksSocks London, UK.Member Posts: 12,822
    @DavidsChannel

    Here you go - example file attached - just click on the screen to place a block:

  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2013
    Way to think outside the 'blocks'...

    See what I did there :)
    @BoomshackBarry

    You've been reported to the GameSalad forum joke police, expect a knock on your door.

    :ar!
  • DavidsChannelDavidsChannel Member Posts: 44
    edited July 2013
    Way to think outside the 'blocks'...

    See what I did there :)
    @BoomshackBarry

    You've been reported to the GameSalad forum joke police, expect a knock on your door.

    :ar!
    @Socks Thank you very much for the effort! But there is one problem though: The overlapping things are kinda cheaty, although they work for your example. My background isn't just purple, it's a pretty random texture. Do you have any other idea? (I want the outline in front of the spawning area) Thanks bud!
  • BoomshackBarryBoomshackBarry Member Posts: 712
    Way to think outside the 'blocks'...

    See what I did there :)
    @BoomshackBarry

    You've been reported to the GameSalad forum joke police, expect a knock on your door.

    :ar!
    The joke police? - 'Ha', I laugh at the joke police...

    *runs and hides*
  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2013
    But there is one problem though: The overlapping things are kinda cheaty, although they work for your example. My background isn't just purple, it's a pretty random texture. Do you have any other idea? (I want the outline in front of the spawning area) Thanks bud!
    @DavidsChannel

    Here you go, the same deal but with a textured background.

  • SocksSocks London, UK.Member Posts: 12,822
    'Ha', I laugh at the joke police...
    Technically that's another joke, if you get a good lawyer you can argue it's just a pun which carries a lesser sentence.
  • BoomshackBarryBoomshackBarry Member Posts: 712
    'Ha', I laugh at the joke police...
    Technically that's another joke, if you get a good lawyer you can argue it's just a pun which carries a lesser sentence.
    I just can't stop, I deserve whatever PUNishment they throw at me...oh man I did it again #-o

    That's enough thread derailing for one day :)
  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2013
    PUNishment
    You are probably looking at a 10 year stretch now.
    8-X
  • DavidsChannelDavidsChannel Member Posts: 44
    @Socks Oh man that's perfect, thanks so much bud! :D But… how did you do it?
  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2013
    But… how did you do it?
    @DavidsChannel

    I could tell you, but it would cost you 10 awesomes.

  • DavidsChannelDavidsChannel Member Posts: 44
    edited July 2013
    @Socks

    Awesomes? So that means I need to "awesome" your posts? :D
  • DavidsChannelDavidsChannel Member Posts: 44
    edited July 2013
    But… how did you do it?
    @DavidsChannel

    I could tell you, but it would cost you 10 awesomes.

    @Socks

    Nope, I just figured it out myself. :D For everybody who doesn't know how it's done: Change the blending mode of the background to screen.

    One question though: Is there a way of having the outline INSIDE the block? (inline) Cause my game is made on a block basis with 20x20px blocks. I just can't have the outline 22x22px big.

  • DavidsChannelDavidsChannel Member Posts: 44
    Em nothing to say?
  • WingmanappsWingmanapps Member Posts: 458
    Draw your blocks 18x18px with 2px line
    Still seems like you're overthinking the task at hand
  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2013
    Draw your blocks 18x18px with 2px line
    Still seems like you're overthinking the task at hand
    @Wingmanapps

    He needs to have the blocks join up, so placing blocks in an 'L' shape will draw a line around the whole shape . . . making the blocks 18x18 (on a 20x20 grid) will mean each block in our 'L' will have an outline, which is not what he wants.

  • SocksSocks London, UK.Member Posts: 12,822
    Em nothing to say?
    I could tell you, but it would cost you 12 awesomes.
Sign In or Register to comment.