User Tag List

Results 1 to 4 of 4

Thread: Transparent yet "Tangible?"

  1. #1
    No Products Registered

    Join Date
    Oct 2008
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Transparent yet "Tangible?"

    Please forgive me if this has been discussed. I tried searching but couldn't find anything.


    Working on a simple platformer. Have fount tutorials useful. While my animation is more detailed than this, for the purposes of detection on the floors/walls I wanted my player character to behave like a square. I added two lines on the outermost parts of his animation (there's a little transparent space on the edges what I don't wish to clip). I did this rather than just leaving it or cropping because his leg sticks out a little when he walks and this was sometimes messing up how he stopped when hitting walls/floors.

    Anyway, I did my best to hide this line using the alpha channel, but when I set the alpha for that line to be all the way transparent, MMF went back to treating that transparent area like it wasn't there. I currently have the line set to one single shade "lighter" than all the way black (transparent). At first I thought this was "invisible but tangible" like I wanted but looking very very closely the line is still slightly opaque.

    So my question - how do you "draw" areas on the animation editor that cannot be seen but are still recognized by hit detection etc as being "there?"

    Many thanks.

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Transparent yet "Tangible?"

    If your player object has a constant size over all its animations, you could uncheck the "Use fine detection" property, and it'll always be treated as if it filled its bounding box. Another approach is to make the actual controlled object a square invisible collision box, and to make the visible player a separate object on top of that.

  3. #3
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)

    Re: Transparent yet "Tangible?"

    DavidN is talking about what are usually called "detectors" - invisible active objects which are always set to the position of the sprite, and work like a collision mask.

    You can also use "embedded collision detectors". That's where the collision mask is just another animation of the same sprite object.
    eg. If a player is walking, you'd change the animation to "walking_collision_mask", check for collisions, and then immediately switch back to the "walking" animation.
    The player will never see the collision mask because the screen is only ever redrawn after the last event has been handled, by which time you've gone back to the walking animation.

    The main benefit of this is that it simplifies working with multiple duplicates of the same object (you don't have to worry about which detector belongs to which sprite, or run fastloops to detect collisions for each sprite in turn - which hurts the framerate).

    There's a more detailed article here:
    http://www.create-games.com/article.asp?id=1639

    It's actually a lot easier than it sounds. I almost never use conventional detector objects these days.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jun 2006
    Location
    St. Ave France
    Posts
    1,166
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Transparent yet "Tangible?"

    @Threeleggedyoyo,

    I highly recommend you get used to using a perfect rectangle active to control players, and then a second "skin" active (an active object containing all of your character animations)to display the players character.

    You use an "Always" event to always set the x and y coordinate of the "skin" active at the same position of the actual rectangle active (which you will later make invisible)

    This method gives you the best control and stability for collisions and interactions with the background (platforms etc).

    there should be many examples out there using this method.

    good luck

Similar Threads

  1. "Cannot load joystick2.mfx" when "Compress the runtime" unchecked. Fine when checked.
    By DistantJ in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 14th September 2013, 09:44 PM
  2. "Rendertarget ping/pong" and "Pixel shaders" Can TGF2 do this?
    By CloudExSolider in forum The Games Factory 2 - Technical Support
    Replies: 13
    Last Post: 7th April 2013, 08:21 PM
  3. "Brushing away" an image, making the brush stroke transparent?
    By Tiny in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 1st October 2012, 12:37 PM
  4. "Bug" For Saving and Loading Frame Positions AND "Timer Glitch"?
    By Zarpo in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 27th March 2012, 12:40 PM
  5. Semi-Transparent "Window"?
    By Mantis in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 29th February 2012, 02:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •