×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    19

    Using Graphics object from different parts of midlet

    Hi guys!

    Is it possible to use one Graphics object from different
    parts of my midlet? For example one class is responsible
    for drawing animated logo and another for drawing scroll line
    at the same time on the same FullCanvas.
    Simple example doesn't work, just nothing happens and
    screen is not updating.

    Thanks

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    72

    RE: Using Graphics object from different parts of midlet

    one way of doing it is having a method in the different classes which can perform the graphics operations on the Graphics objects you pass it, a very quick example;

    public class MyCanvas extends FullCanvas
    {
    protected void paint( Graphics g )
    {
    instanceOfMyLogoAnimatorClass.draw( g );
    instanceOfMyLinedrawingClass.draw( g );
    }
    }

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    19

    RE: Using Graphics object from different parts of midlet

    Thanks.

    But there is still a problem. I'm using different refresh rate
    for animated logo, and scroll line. Logo I need to update
    every second, but scroll line every lets say 1/4. And I still
    need processor power to draw other stuff on the screen which
    depends on user input. I'm trying to find more optimal way to
    do so. Anyway thanks for advice.

Posting Permissions

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