×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 28
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    2

    Device 6280 - LayerManager and Sprite - strange behavior

    I have a Class that extends from class Sprite.
    After I append this class to a LayerManager object
    I'm using the Sprite functions defineReferencePixel() and setRefPixelPosition() to set the object position.
    The problem is that it seems the object is not drawing in the right place
    to be precise, twice more on the X and Y axis.
    the code works fine on other devices except the nokia 6280,
    anyone know of this problem or a workaround?

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Device 6280 - LayerManager and Sprite - strange behavior

    selaoren, have you been able to solve your problem? I do not exactly understand what you mean with "twice more on the X and Y axis". Have you tried with other handsets or emulators? If yes, is the behavior different?

    If you still have a problem, would it be possible to see a code sample and more detailed explanation what goes wrong.

    Hartti

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

    Post Re: Device 6280 - LayerManager and Sprite - strange behavior

    hi hartti,
    i encountered the problem only on the nokia 6280 handset & emulator.
    other handsets like nokia 6680 worked just fine.
    here's a more detailed explanation of the problem:
    assume i have a sprite 50x50 pixels that i want to draw at (100,100) display coordinate. I want to set a reference point to hold it from it's bottom center, so i use defineReferencePixel(25,49) and then call setRefPixelPosition(100,100).
    the expected result would be to see the sprite drawn (top left) at (75,51),
    but the actual result on the 6280 is that the sprite is drawn (top left) at (50,0) which is twice the pixel delta.
    if i call defineReferencePixel(12,24) i will get the (75,51) desired result but in that case, beside the fact that this is a patch up solution, i also encounter problems while trying to apply transformation on the sprite.
    at the moment, i solved the problem by just overriding the defineReferencePixel() and setRefPixelPosition() functions, and implement them by myself (though the transformation issue wasn't completly solved).
    i would like to mention that the sprite is a part of a LayerManger object, and is drawn by calling the LayerManager's paint().
    do you know about this bug, or have any suggestions?
    thanks,
    oren

  4. #4
    Registered User
    Join Date
    Jul 2006
    Location
    Berlin
    Posts
    25

    Question Re: Device 6280 - LayerManager and Sprite - strange behavior

    hi,

    i encountered the same problem.

    a rotation of a 2-frames image around a refpoint inside the first frame (myObject.defineReferencePixel(4,49)) goes wrong the way, that the centre of the rotation is drawn some pixels above the position the sprite is appended to the layerManager.

    I cannot really measure a pixel count, because only have a dig. video showing the behavior, but it seems that seleaoren is right in his theory.

    the problem did not occure on other handsets from different manufacturers (two hands full tested, nokia included).

    any patch or workaround in sight?

    regards ray()
    Last edited by ray(); 2006-07-08 at 17:46. Reason: some additions

  5. #5
    Registered User
    Join Date
    Jul 2006
    Posts
    1

    Re: Device 6280 - LayerManager and Sprite - strange behavior

    i have da same problem.........and i've encountered it only on a 6280 device too..........did you've found any solution to the problem?
    regards

  6. #6
    Registered User
    Join Date
    Jul 2006
    Location
    Berlin
    Posts
    25

    Re: Device 6280 - LayerManager and Sprite - strange behavior

    not at the moment. seleaoren already described a workaround (for 6280 only, same thread, other branch). but i didn't check it, because i'm more than busy. will be later.

  7. #7
    Registered User
    Join Date
    Jul 2006
    Location
    Berlin
    Posts
    25

    Re: Device 6280 - LayerManager and Sprite - strange behavior

    hi selaoren,

    can you tell me the (range of) return(s) System.getProperty ("microedition.platform") delivers for any affected device?

    tia ray()

  8. #8
    Registered User
    Join Date
    Jul 2006
    Location
    Berlin
    Posts
    25

    Question Re: Device 6280 - LayerManager and Sprite - strange behavior

    sorry, may be this was a little bit to short.

    i would like to know, how to tell the correct phones from the 6280-family. i suspect that System.getProperty("microedition.platform") will provide this information.

    because there is no 6280 accessible at the moment, it would be nice to read here what returns are to be expected for the "family".

    may be i'm totally wrong and System.getProperty ("microedition.platform") cannot help me, what are you doing to patch your games when?

    ray()

  9. #9
    Registered User
    Join Date
    Jul 2006
    Location
    Berlin
    Posts
    25

    Re: Device 6280 - LayerManager and Sprite - strange behavior

    hi oren,
    can you please provide me a link to a 6280 emulator. i couldn't find one.
    regards ray()

  10. #10
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Device 6280 - LayerManager and Sprite - strange behavior

    The Series 40 3rd Edition SDK contains the emulator one should use for 6280 testing.
    http://www.forum.nokia.com/info/sw.n...form_SDKs.html

    The "microedition.platform" is the correct property string. The return string starts with "Nokia6280" for 6280 phones.

    Hartti

  11. #11
    Registered User
    Join Date
    Jul 2006
    Location
    Berlin
    Posts
    25

    Smile Re: Device 6280 - LayerManager and Sprite - strange behavior

    good news. thanks ray()
    Last edited by ray(); 2006-07-20 at 08:19. Reason: added an icon to the posting

  12. #12
    Registered User
    Join Date
    Jul 2006
    Location
    Berlin
    Posts
    25

    Re: Device 6280 - LayerManager and Sprite - strange behavior

    hi hartti,

    i assume devices not returning "Nokia6280" will not show this issue. am i right?

    ray()

  13. #13
    Registered User
    Join Date
    Jul 2006
    Location
    Berlin
    Posts
    25

    Question Re: Device 6280 - LayerManager and Sprite - strange behavior

    (A)

    this doesn't seem to be the case. the emulator returns "Nokia6270/p03.20" AND shows the issue.

    BTW: the handset where the issue occured returns "Nokia6280/03.60"

    so maybe i have to handle a wildcarded return of "Nokia62*/*03.*" ???

    will this target all issued handsets?


    (B)

    the patch oren suggested (set the refpixel to half x and half y needed) failed because transformations (combinations of rotations and mirrors) lost their correct centre.

    instead i only added the refpixels coordinate to the sprites coordinate and the transformations worked well (at their correct location)

    this is my favorite workaround.

    regards
    ray()

    p.s. can anybody answer (A)?
    Last edited by ray(); 2006-07-20 at 14:32. Reason: another patch added

  14. #14
    Registered User
    Join Date
    Jul 2006
    Location
    Berlin
    Posts
    25

    Re: Device 6280 - LayerManager and Sprite - strange behavior

    hi all,

    if nobody knows if a wildcarded return of "Nokia62*/*03.*" would cover all affected devices, may be someone knows where i can read this (a link, a book, ...??

    tia

    ray()

  15. #15
    Registered User
    Join Date
    Jul 2006
    Location
    Berlin
    Posts
    25

    Exclamation Re: Device 6280 - LayerManager and Sprite - strange behavior

    dear friends,

    i think it's now time to open a new branch for this thread.

    here is a short description for the issue:

    - a sprite which's refpixelposition was set to a delta value, will be transformed regarding this refpixel, but the delta value is not used for positioning the sprite


    let me summarize, what was done in the meanwhile

    a) in former branches 2 workarounds were described:

    1. Modify the sprites refpixelposition (transformations will work regarding a changed refpixel)
    2. Modify the sprites location (add the delta value)


    b) the issue is reproducable with the series 40 sdk 3rd edition emulator


    c) the emulator shows the issue for an emulated nokia 6270, the issue was originally reported for a Nokia6280. there was no further device affected reported (but one can be supected below the series 40 sdk 3rd edition implementors)

    d) the idea is to deal with the return of System.getProperty("microedition.platform") to determine a device affected.

    this is the status quo

    ray()

Similar Threads

  1. animating separate Spriteson top of LayerManager
    By idrop in forum Mobile Java General
    Replies: 0
    Last Post: 2003-10-13, 15:38

Posting Permissions

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