Changes between Version 183 and Version 184 of AndroidPort


Ignore:
Timestamp:
Jan 29, 2012, 11:02:31 AM (12 years ago)
Author:
Anders Feder
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AndroidPort

    v183 v184  
    2626
    2727== Design ==
    28 === Input events ===
    29 As far as I understand from the wiki, handlers for input events are specified in XML and !JavaScript. So I am wondering if it would be a possibility to simply add a range of new events (e.g. !TouchDown, !TouchUp, etc.) for the engine to handle? Then the port could simply be supplied with a new set of XML and !JavaScript files for the UI, but retain most everything else.
    30 
    31 The game's input events originate from SDL, so the real question is does SDL support these Android-specific events? At least in the development branch there is an [http://wiki.libsdl.org/moin.cgi/SDL_TouchFingerEvent SDL_TouchFingerEvent] that should work for this. You only need to add new events to the GUI XML schema if you're going to add new GUI object types, which might be reasonable on an Android port. I'm thinking it would be easiest to avoid that until absolutely necessary. Either way the GUI manager will need to be extended to capture these events and pass them onto scripts like the session input.js, which is where the most interesting event handling occurs (unit selection, building placement, etc.) Unfortunately the GUI engine code is a mess.
    32 
    33 Check out !HandleEvent in ''source\gui\CGUI.cpp''. See also EGUIMessageType in GUIbase.h. In fact you should be familiar with most of ''source\gui''. For the XML parsing you'd want the CGUI::Xeromyces_* methods at the bottom of CGUI.cpp. For camera movement, see the CGameView class in ''source\graphics\!GameView.cpp''.
    34 
    3528=== User interface ===
    3629Due to the vastly different controls and form factor, the whole user interface of the game needs to be rethought.
     
    9386
    9487 * Double-tap position in game world - apply selected unit's primary action to the position.
     88
     89=== Input events ===
     90As far as I understand from the wiki, handlers for input events are specified in XML and !JavaScript. So I am wondering if it would be a possibility to simply add a range of new events (e.g. !TouchDown, !TouchUp, etc.) for the engine to handle? Then the port could simply be supplied with a new set of XML and !JavaScript files for the UI, but retain most everything else.
     91
     92The game's input events originate from SDL, so the real question is does SDL support these Android-specific events? At least in the development branch there is an [http://wiki.libsdl.org/moin.cgi/SDL_TouchFingerEvent SDL_TouchFingerEvent] that should work for this. You only need to add new events to the GUI XML schema if you're going to add new GUI object types, which might be reasonable on an Android port. I'm thinking it would be easiest to avoid that until absolutely necessary. Either way the GUI manager will need to be extended to capture these events and pass them onto scripts like the session input.js, which is where the most interesting event handling occurs (unit selection, building placement, etc.) Unfortunately the GUI engine code is a mess.
     93
     94Check out !HandleEvent in ''source\gui\CGUI.cpp''. See also EGUIMessageType in GUIbase.h. In fact you should be familiar with most of ''source\gui''. For the XML parsing you'd want the CGUI::Xeromyces_* methods at the bottom of CGUI.cpp. For camera movement, see the CGameView class in ''source\graphics\!GameView.cpp''.
    9595
    9696=== Graphics ===