×

Discussion Board

Results 1 to 15 of 21

Hybrid View

  1. #1
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    353

    does Canvas support layering?

    Does the Canvas class support layering or Depth?
    For instance, if I draw a Box on the canvas and then overlap it with a Circle partially, is it possible to get the original box back, or is the overlapping Area overwritten by the Circle?

    Are there any third party UI libraries that support layering?

  2. #2
    Super Contributor
    Join Date
    Apr 2009
    Posts
    572

    Re: does Canvas support layering?

    No canvas doesnt support layering however you can acheive what U want by intelligent paintaing

    Regarding 3rd party there are numerous LWUIT j2me Polish are name to few
    Regards,
    Saurabh

  3. #3
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Re: does Canvas support layering?

    well the GameCanvas does have something called a LayerManager which is to be used in combination with Layers (and Sprites)...
    You might want to have a look at that ?

  4. #4
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    353

    Re: does Canvas support layering?

    @ingsaurabh: what is intelligent painting?

    @Tiger: More than sprites, I would like to have the ability to place custom components on the Canvas is it possible to do that.
    For example can I create a CustomItem and place it on the canvas, or is there some way where I can place components on Canvas.

  5. #5
    Nokia Developer Expert
    Join Date
    May 2007
    Location
    Mexico D.F
    Posts
    351

    Re: does Canvas support layering?

    Quoting you:

    For instance, if I draw a Box on the canvas and then overlap it with a Circle partially, is it possible to get the original box back, or is the overlapping Area overwritten by the Circle?
    I would say that as Tiger mentions you need to use a LayerManager. This class allows you to put different items (Layers) pile them, and paint them according to your needs. Every Layer is independient and won't affect the other ones.

    A Sprite it's just a kind of Layer, if you want to create your own, just inherit the Layer class and overwrite the paint() method.

    Please check the GameCanvas documentation.
    :Ruben

  6. #6
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    353

    Re: does Canvas support layering?

    @rdrincon

    The Sprite Class usually uses a image input either single or in the form of a film strip.

    Is it possible for instance, If I was to make a custom button, then I inherit Layer without an image, and create a button by drawing a rectangular box and filling it with a pre-defined color and then I could use this on the canvas?

  7. #7
    Nokia Developer Expert
    Join Date
    May 2007
    Location
    Mexico D.F
    Posts
    351

    Re: does Canvas support layering?

    Yes, just inherit the Layer class and paint your box inside the paint method that you have to overwrite.


    Code:
    public class MyOwnLayer extends Layer{
    
    public void paint(Graphics g){
    //Paint your box with g
    }
    
    }
    Now you will be able to add an instance of MyOwnLayer to any LayerManager.
    And please, don't forget to make the MyOwnLayer instance visible


    Code:
    myOwnLayerInstance.setVisible(true);
    :Ruben

  8. #8
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    353

    Re: does Canvas support layering?

    @Ruben
    Does that mean, this Layer instance is now a custom component and I can play with it and move, render and modify it at will on the canvas.

Similar Threads

  1. Clarifications/Information required about Technical Support case
    By mevasudeva in forum Feedback - Nokia Developer Services & Infrastructure
    Replies: 4
    Last Post: 2008-01-10, 13:39
  2. Technical Support Engineer, Mobile, London
    By mobile2004 in forum Symbian C++
    Replies: 0
    Last Post: 2004-11-05, 09:40
  3. Technical Support Engineer, Mobile, London
    By mobile2004 in forum Symbian C++
    Replies: 0
    Last Post: 2004-11-05, 09:38
  4. Technical Support Engineer, Mobile, London
    By mobile2004 in forum Symbian C++
    Replies: 0
    Last Post: 2004-11-05, 09:33
  5. Replies: 0
    Last Post: 2004-08-25, 11:42

Posting Permissions

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