×

Discussion Board

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

    6600 weird behaviour with setClip

    Hey guys, just wondering if anyone here has run into this following problem when using the 6600 and setClip.

    Anyway, what I'm doing is the following.

    I have a method that is supposed to draw a character from a frame strip that has 5 rows and 3 columns.

    The character can move in 8 directionss so 5 of the directions are already included in the strip and 3 of them are drawn by flipping the image. Anyway, on S40 phones and the S60 emulatos this works just fine, no problems at all.

    But now when I try it on a 6600 I for some reason see the whole image there, instead of just one of the frames.

    Anyway, in my draw method I first set the clip region on the Graphics object, that clip region has a width and height that is exactly as big as one frame.

    After that, if I need to flip the Image I create a DirectGraphics object using dg = DirectUtils.getDirectGraphics(g); After that I then draw the image at the location I want but now on my phone it ends up drawing the entire Image, despite me setting a clip region that has a width and height that would allow it to draw only a single frame.

    Has anyone run into these kinda problems on their 6600 phones before this ? I tried to do a quick lookup here on the forums but at least I couldn't spot anyone writing about this so....

    The Firmware I have in my phone is 3.42.1

    Any help or work arounds would be greatly appreciated!!
    Edi

    Just a thought, would it work if I'd go and use clipRect every time after I've used setClip, maybe that'd ensure that the clip really is set as I want it to be.....

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    10
    I ran into the same problem.
    Anyway Nokia 6600 is MIDP 2 so may be you can use
    Sprite Transforms.
    I didn't try that myself, so if it work please let me know.

    Sing

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    18
    I actually solved it by adding

    g.clipRect(....) immediately after the setClip() command with the same area specified as in setClip(...)

    This seems to do the trick

Posting Permissions

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