(Fancy Hikari Logo)
Meet Hikari (hee-kah-ree), a small yet powerful library that makes it easy to use Flash content in Ogre3D. The possible applications include:
- Create the interface for your game in Flash
- Play Flash movies as cut-scenes in your game
- Embed Flash mini-games in your game
- Combine Flash with 3D to make novel interfaces
- Use Flash for animated decals on 3D models
Basic overview of using Hikari:
- Step 1) Design your interface in Flash
Step 2) Export to SWF files.
Step 3) Create the HikariManager.
Step 4) Create a FlashControl for each SWF using the HikariManager.
Step 5) Load the SWF files into each respective FlashControl.
Step 6) Bind callbacks in ActionScript and C++.
Step 7) Inject mouse input into the HikariManager.
Step 8) Call HikariManager::update from your update loop.
- Efficient updating with dirty-rectangling
- Full transparency support
- Load the Flash ActiveX control from the registry or a local file
- Create a FlashControl as a movable overlay or pure material
- Bind C++ functions to handle function calls from ActionScript
- Call ActionScript callbacks from C++
- Support for communication of basic ActionScript types (null, boolean, number, string)
- International string support
- Minimal impact on application size
- Hikari is licensed under the Lesser GNU Public License (LGPL) with one stipulation: if you use it, tell me about it!
(Screenshot from the v0.2 Demo)
- The demo is extremely simple (I began learning Flash about 4 days ago) but is certainly enough to demonstrate the basic implementation. Play with the slider and color-picker and drag around the FlashControls by holding down the right-mouse-button.
Download the Hikari Demo (v0.2)
- To build from source, you need to have Flash Player 9, the OgreSDK, and at least MSVC2005.
Download the Hikari Source (v0.3)
- For discussion and support of Hikari, you may wish to visit our forums.
- The API headers are fully documented using Doxygen-compatible comments-- I will generate the online docs later.
For articles and tutorials about use of Hikari, see the Hikari Wiki.
How is Hikari implemented?
When you create a FlashControl using the HikariManager, here's what happens:
- The Flash ActiveX control is loaded (either from Flash.ocx in the working directory or from the registry).
- It is embedded into a Windowless OLE site.
- An event handler is bound to the OLE object to handle various Flash events.
- Invalidations are caught, the dirty area is expanded.
- Mouse input is injected by translating it into native window messages which are then sent directly to the Windowless site.
- Keyboard input is handled by directing all keyboard messages (using a message hook) to the focused FlashControl. (To accommodate complex keyboard input)
- During a global update, if a FlashControl is dirty, the dirty area is rendered and merged with an internal buffer, which is then blit to a dynamic texture using Ogre3D's facilities.
Have fun! <3