GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Make a Light

JoshKahaneJoshKahane Posts: 470Member
edited 12:54PM in Working with GS (Mac)
Hi

I was wondering if it was possible in GameSalad to make a light? I was thinking you would do it with a particle behavior or something, but I don't know. Is it possible? Thanks.

Comments

  • JGary321JGary321 Posts: 1,246Member
    Explain a bit. You can making a "light" using animations. What are you using this "light" for? That may help us to lead ya in the right direction.
  • quantumsheepquantumsheep Posts: 8,188Member
    I was sure you were going to say 'light the way' ;)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: http://www.quantum-sheep.com

  • JGary321JGary321 Posts: 1,246Member
    Pun = evil
  • quantumsheepquantumsheep Posts: 8,188Member
    I was only making light of the matter...

    Badooom-TSSH!

    You've been a great crowd! I'm here all week folks! Try the veal, it's delicious etc etc ;)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: http://www.quantum-sheep.com

  • JoshKahaneJoshKahane Posts: 470Member
    Haha, enough with the cringe worthy puns guys, haha. What I mean is, for instance, if my character was going through a dark room and I had a light in the middle, it would increase the lighting of what passes it. Make sense? Or would I just have to make fake lights with graphics?
  • superNESsuperNES Posts: 166Member
    CodeMonkey, correct me if I'm wrong. I think you'll need to create an overlay layer for your level. Essentially a black (or near opaque) foreground element that takes up the entire screen that has transparency "holes" punched in it where the light should be. As the character approaches these "holes" the transparency makes it appear like the character is emerging from the darkness. You'd then add the glowing actors that would represent the light centered on these areas.
  • CodeMonkeyCodeMonkey Posts: 1,803Head Chef, Member, PRO
    So do you mean like this: http://www.gamesalad.com/game/play/6388

    The problem with that is that the hole where you can see through is set in a big image, and adding new 'light sources' will not make more areas viewable.

    So currently you can not blend colors to brighten a room. Only darken everything else around it.
  • JGary321JGary321 Posts: 1,246Member
    CodeMonkey - what about adjusting the alpha/colors or something? Couldn't you give off the illusion of "light" by having a circle area that when passing over the (dark, but visible background), would lighten it up by using alpha/adjusting colors. This is just theory, but I would think I "might" work. What do you think Monkey?

    Or... I can't remember but you can adjust transparency i believe of an actor. What about having your normal background, then a black actor right above it. Somehow make it so when you move your character it would make the black part transparent, so the real background would show. Again just theory, not sure if this is presently possible or not.

    Anyone else have any ideas?
  • JoshKahaneJoshKahane Posts: 470Member
    http://www.gamesalad.com/game/play/6388

    Just like that, except, where it is black on the above game, I want it a bit more transparent. So would I make an actor like SuperNES said? Then make that actor follow over the top of my character actor?
  • CodeMonkeyCodeMonkey Posts: 1,803Head Chef, Member, PRO
    You can adjust transparency, but you would probably need lots of actors to cover the screen.

    Ignore my first response. You can make a light colored actor and change the transparency of that , but not sure how good that would look.
  • CodeMonkeyCodeMonkey Posts: 1,803Head Chef, Member, PRO
    Yep. Make a black png image with an alpha transparent hole in the center. Add that image to GameSalad, then use it on an actor that follows your player actor. (via wiki how-to)

    Adjust the alpha on the shadow actor as necessary.
  • Vanny_ArtsVanny_Arts Posts: 16Member
    {if my character was going through a dark room and I had a light in the middle, it would increase the lighting of what passes it. Make sense? Or would I just have to make fake lights with graphics? }

    Well I'm not a genius,but what runs in my mind is what Supernes said,but a little different.

    O.K Your room is black with a light in the meddle:
    Layer 1 = black background
    Layer 2 = Player
    Layer 3 = Light-(like a switch {with overlay setting and Transparent masking}

    Player could overlap with light / when it passes.

    While the player overlap with Light; the light could turn bigger with animation to make it bigger/brighter and after overlap; animation to go back to the light 1st frame.

    I might be wrong but this the way I could think of. my problem would be in how to code it.
    This really hurt me just thinking about it. LOL or maybe I don't know what I'm saying.
  • dandan Posts: 28Member, Chef Emeritus
    In GameSalad 0.8.9, we added additional support for blending modes. For anyone just now coming across this thread, lighting effects can be done by using the 'additive' or 'screen' blending modes. Which one you choose depends on the brightness of your background, and how 'contrast-ey' you would like the effect to be.

    A better shadow effect can now by done by using a gradient image with the 'multiply' blending mode.

    For more information on blending/compositing modes available in GameSalad, see:
    http://gamesalad.com/wiki/interface_reference:actor_attributes#graphics
This discussion has been closed.