Results 1 to 4 of 4
  1. #1
    eLancaster is offline Member
    Join Date
    Jan 2011
    Posts
    93
    Rep Power
    0

    Default Fade in/Fade out Class for any object

    I want to start working on a class that can take in any object and fade it in and fade it out. An outline would be
    Java Code:
    public class Fade{
     public void FadeIn(Object O)
    {
    //code
    }
     public void FadeOut(Object O)
    {
    //code
    }
    
    }
    Is this possible?
    Could someone give me an idea on how to fade objects in and out.

  2. #2
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default

    I think I know how to do this with Colors, something like this:

    set the object to Opaque,
    set the background colour,
    set a timer to alter the opacity of the background colour over a fixed period of time

    for example, over 5 seconds the opacity changes from 0% to 100%.

    to set a color with opacity just do this:
    Color red50 = new Color(255,0,0,127);

    where '127' is the alpha value giving the colour 50% opacity.

  3. #3
    doWhile is online now Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

    Default

    take in any object and fade it in and fade it out
    Fade in/out what element(s) of that object? Do you mean fade in the sense of drawing it in a user interface? Object contains no methods related to 'fading', so the question doesn't make much sense (at least to me).

  4. #4
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default

    I think he means that he wants to create some sort of Frame or displayable object, maybe a dialog, and when its shown fade all of its components in and out.

Similar Threads

  1. Replies: 1
    Last Post: 02-02-2011, 06:11 PM
  2. Replies: 2
    Last Post: 06-22-2010, 04:29 AM
  3. Replies: 3
    Last Post: 03-15-2010, 08:44 PM
  4. Alpha Fade Flicker
    By jamesfrize in forum Java Applets
    Replies: 3
    Last Post: 04-02-2008, 02:02 PM
  5. Creating object of Type Object class
    By venkatv in forum New To Java
    Replies: 3
    Last Post: 07-17-2007, 03:33 PM

Posting Permissions

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