can't accuracy pick object In IPhone

edited May 2010 in Help request
ORX is great,it's just the thing I wanted to write by myself(except I would write it with C++) and more than I could write.

I have to say,I love it because it supports IPhone.(my work is about the platform)
But because of it's portable,many special IPhone features didn't get enough support. And the touch supported like a mouse left button,accelerator supported like a Joystick(lost the Z axis).It's not a good thing for IPhone............for me too.

It's not the biggest problem yet, if I simulate touch with mouse left button down, It's not accuracy(or not sensitive enough).If the object is small and I use the orxObject_Pick funtion to get the object player picked,I always lost many input..................How to solve it?
My be because the touch always have a range but mouse only click a point?


BTW,another question, run callback funtion is how to use and called in what frequency? I do the update to check state with clock and found it unuseful.
and If I want to render something myself(like use opengl es to draw some debug lines),where I can do this.
orx haven't a callback funtion like render or draw or something like these.

Comments

  • edited May 2010
    I almost Forget the most import question.I look forward the last stable iphone version orx,when it release?And what features added to it?
  • edited May 2010
    Hi jtianling!

    jtianling wrote:
    ORX is great,it's just the thing I wanted to write by myself(except I would write it with C++) and more than I could write.

    Thanks for the compliment! =)
    I have to say,I love it because it supports IPhone.(my work is about the platform)
    But because of it's portable,many special IPhone features didn't get enough support. And the touch supported like a mouse left button,accelerator supported like a Joystick(lost the Z axis).It's not a good thing for IPhone............for me too.

    I might have missed important points to support for iPhone, and I'd be happy to fix that if you can make a list of what you'd think would need more support.

    For the mouse & joystick, they are mainly convenience wrappers so as to be able to use the generic input module, like for other platforms.

    However, the full iPhone events are entirely forwarded by orx. The event type is orxEVENT_TYPE_IPHONE and the IDs are:
      none
    • orxIPHONE_EVENT_TOUCH_BEGIN/_MOVE/_END/_CANCEL: these give you all the info about the touch, include the NSSet touch list.
    • orxIPHONE_EVENT_MOTION_SHAKE: iPhone OS 3.0+ only, used for shake motions
    • orxIPHONE_EVENT_ACCELERATE: accelerometer event including the accelerometer instance + acceleration datanone

    By the way, the accelerometer Z acceleration data is transfered to the joystick Z axis, so you don't lose any data using the joystick/global interface.
    It's not the biggest problem yet, if I simulate touch with mouse left button down, It's not accuracy(or not sensitive enough).If the object is small and I use the orxObject_Pick funtion to get the object player picked,I always lost many input..................How to solve it?

    I'm simply transfering the touch info. Touch info are not zones but a simple position. Apple uses an algo to estimate which ponctual position corresponds the best to the touch. Orx only transfers this to the mouse module but doesn't truncate any data.

    If you want to have a more permissive picking, instead of using a simple point, you could use a zone such as a box and I can add a orxObject_ZonePickObject() function to help you with that if you want.
    My be because the touch always have a range but mouse only click a point?

    Touches are simple points, and when this point moves, I relay the information through events (see above). I also listen to these events to update the mouse module.
    BTW,another question, run callback funtion is how to use and called in what frequency? I do the update to check state with clock and found it unuseful.

    The run callback is only useful in non-iPhone platform and is mainly used for an exit condition.
    and If I want to render something myself(like use opengl es to draw some debug lines),where I can do this.
    orx haven't a callback funtion like render or draw or something like these.

    You can listen to the orxEVENT_TYPE_DISPLAY+orxDISPLAY_EVENT_RENDER_START/_STOP events for that. You'll have to call OpenGL call manually but I never did that this way so I don't know how well it'll work.
    As orx doesn't provide a drawing API, I tend to load a single pixel image and stretch it where I want to display lines.
    With the next 1.2 release, you'll be able to fill the content of the images programmatically, at runtime, but it's not available in the current beta package.
  • edited May 2010
    jtianling wrote:
    I almost Forget the most import question.I look forward the last stable iphone version orx,when it release?And what features added to it?

    I plan to release 1.2 around end of may. There won't be much new features for the iPhone version, except for the ability of modifying texture contents on-the-fly at runtime.
    I'll probably also add OpenGL ES 2.0 support for Iphone 3GS & iPod 3G. This will add custom shader support for these platforms.

    The major changes from the last beta release will concern non-iPod platforms with brand new SDL/OpenGL/OpenAL plugins that are more efficient than the previous SFML-based ones.
  • edited May 2010
    Thank you, I learned so mush from your reply.May be I could use a bigger object to pick for this.
    And I have known I could use Event call back to get all the information I want.............sorry for my lack of knowledge about IPhone and orx.
    The input things all the most of need I wanted in orx, Now I knew orx meet it.

    At last,except using pick_object things to simulate a button. Is there a better way to make a button or menu?
  • edited May 2010
    Add some suggestion,when there isn't a animation editor(sure there isn't)ORX's animation is too hard to set.......even in tutorial,there are so mush dirty work to get the soldier move.....Can Orx support some 3rd party sprite/animation editor to simplify these part?

    I found it easy to use orx to make physics game(that's great except non-supporting the joint)but hard to make a game with many animations.........
  • edited May 2010
    BTW: there is no great 3rd animation/sprite editor exist in open source world.(at least I didn't found).
  • edited May 2010
    Orx still can't display text?Why I can't create it from config?......
  • edited May 2010
    jtianling wrote:
    Thank you, I learned so mush from your reply.May be I could use a bigger object to pick for this.
    And I have known I could use Event call back to get all the information I want.............sorry for my lack of knowledge about IPhone and orx.

    No worries, I'm happy to help. Also I'm sure any question answered here will be helpful for newcomers in the future. :)
    The input things all the most of need I wanted in orx, Now I knew orx meet it.

    At last,except using pick_object things to simulate a button. Is there a better way to make a button or menu?

    I'm afraid you'll have to pick for buttons/menu. However, there are 2 config properties very helpful for UI objects: ChildList, that allows you to create a lot of different objects (even the whole UI) with only one line of code and ParentCamera, that makes sure your UI objects will move with your camera.

    In addition to that, the UI objects will still be correctly positionned when your camera changes of aspect ratio if you define their position/scale relatively to the parent camera. It's also very useful if you want your UI to follow the orientation of the device: when you notice the device has turned, you only need to rotate your camera, all the UI objects will then follow.

    When you want to hide UI objects, you don't need to destroy them, you can simply move them outside of the camera frustum, it's done very easily by moving only the root of your UI hierarchy (the one that creates all other objects with the ChildList property).
  • edited May 2010
    jtianling wrote:
    Add some suggestion,when there isn't a animation editor(sure there isn't)ORX's animation is too hard to set.......even in tutorial,there are so mush dirty work to get the soldier move.....Can Orx support some 3rd party sprite/animation editor to simplify these part?

    I know that defining the animation graph is the most annoying part right now. By far. I'd love to have a visual editor where you'd only drag arrows between boxes, but I don't have time to make it myself (and I also hate writing GUI programs).

    Theoritically you don't need to define all the links, but in this case the auto-chaining of animations won't work, you'll have to start all the animations manually in code, the way it's done in most of game engines. I don't think it's less work in the end, but it's probably less tedious.
    I'll check to see if this work correctly with the current version of orx soon.
    I found it easy to use orx to make physics game(that's great except non-supporting the joint)but hard to make a game with many animations.........

    True, and you can look at Mushroom Stew, a small platformer game I released a couple of months ago using orx and scroll (scroll being a layer on top of orx that brings the concept of maps/levels). The whole source code is available and binaries for win/linux & mac are also part of the package. There are many animated objects in this game, but as the graphic assets couldn't been changed, I had to duplicate the animation graph definition between all the different types of mushrooms, which is something you wouldn't need to do if you could modify the assets.

    Here's the link: http://gamejolt.com/open-source/games/platformer/mushroom-stew/1369/
  • edited May 2010
    jtianling wrote:
    Orx still can't display text?Why I can't create it from config?......

    I'm afraid you'll have to be more specific. Did you get the 1.2 beta package? In there the demo should be able to display text bouncing amongst the balls.
    Let me know if it's not the case.

    For a text object, you only need a normal object and its graphic part would point to a text instead than of a texture. If both are defined, the texture has priority.

    If you want to use a custom font, you need a bitmap with all the characters and then define it in config (bitmap + list of characters + size of a character). Only monospace fonts are supported so far.

    If it's still doesn't work, please send me a zip with your source file (at least the part that doesn't work, not the whole thing) and I'll see if I can find the problem.
  • edited May 2010
    jtianling wrote:
    Orx still can't display text?Why I can't create it from config?......

    Hi Jtianling,

    I don't know if this will be any help, but I implement basic text in my tutorials (tutorial 3)

    The relevant parts are essentially this:
    [ObjectIWantToLoadInCode]
    Graphics = TextToLoad
    
    [TextToLoad]
    Text = StringDefinition
    
    [StringDefinition]
    String = This is the text that will appear in game!
    

    ObjectIWantToLoadInCode is the thing you'll, well... load in the code.

    TextToLoad is the position and colour definition object, so move this around [ position = (1,2,3) ], and change the text colour [ color = (255,0,125) ]

    StringDefinition is the actual text that you want to appear on the screen.

    Good luck!
  • edited May 2010
    Thank you all for your kind.

    That helps me so mush.
  • edited May 2010
    Thank you all, That really helps.
  • edited May 2010
    No trouble, that's why we are here. :)
  • edited May 2010
    Oh, you are so kind.....
Sign In or Register to comment.