Attaching images to image frames?

This forum is currently in read-only mode.
From the Asset Store
Selection frame like in RTS games, works both on mobile and desktop devices.
  • I want to make shadows for each character, and I was wondering if it's possible to program it where a shadow pic could just be attached to the character. Here is an explanation:

    'A' represents the character

    'B' represents the shadow

    I want to program it where 'B' attaches itself to 'A', and makes 'B' move with each direction 'A' has.

    Now, I know I could just increase the size of the character image and then draw a shadow for each frame, but the problem there is that I would have to increase the size of my characters, and it would increase the memory size which I don't want to do because I have so many characters, plus it would degrade quality since my characters are drawn in a smaller size.

    Any help is much welcomed!

  • Are you using separate animation angles? Are you trying to make the shadow based of a fake light source? Why do you need to make the character bigger? There is a drop shadow effect as well as a plugin (those attach to the sprite). I think that's what you are looking for. You want the shadow to move in the direction the player has, but I don't quite see why you would need to do that. I use math to move a shadow in 360 on the floor of the character based on the pseudo light soruce. The description sounds like you want to do something else with the shadow.

  • You know there is a dropshadow object?

    To attach a dropshadow object to multiple instances you simply put it in a container with the sprite.

    Then at start of layout you do a for each on the dropshadow attaching it to the sprite.

    Same goes for a dropshadow made out of a sprite, but instead of start of layout you do an always event and for each on the shadow sprite -> set position to container object.

  • I'm making a game with a pseudo-3D perspective. Here is an example of the board:

    <img src="http://farm5.static.flickr.com/4010/4578407533_5122e7cd02_b.jpg">

    The shadows would work like this:

    <img src="http://farm5.static.flickr.com/4010/4579037456_484d6aab37_o.jpg">

    The black object represents the shadow.

    @newt - yes. I used the example you gave and it works fine, but I'm trying to get a shadow that flattens itself to match the pseudo-3D gameboard. I'm not sure if it's even possible, but perhaps I could attach my own drawn shadow using the same example you gave? I haven't tried that yet. If you know of other ways as well I'd love to hear about those, too.

    @manontherun - In reference to increasing image size, I meant this: my characters are a specific size (small) and there is no room on the current images to draw a ground shadow. So, I could take the images into GIMP and then put them on a larger canvas, then draw the shadow on that canvas (because I'll have more space on the image to do it since I've put the image on a larger canvas).

    I have a question for you: if I were to break each direction down by angle, would I be able to just attach a drawn image (shadow) to the main drawn image (character) in events? So, when the character moves to, say, 45 degrees the ground shadow does the same, etc.? My only concern however, is that the shadow may not move smoothly in each direction... I mean, it may look like a lot of frames are being skipped.

  • *crickets*

    in-e-bah-dee?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That would depend on how you are moving the shadow caster, and how many angles your allowing it to use. You can avoid "extra" angles by setting the number of directions in preferences.

  • ^^^ Thanks for the info. I'm going to try that and report back soon.

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