Hikari (v0.3)

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
Post Reply
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10
Contact:

Post by DanielSefton »

ExternalInterface has had many reports of being buggy in AS2. But I'll try what you suggested, because AS3 does my head in.

I'm not sure if it would work in Hikari, but it is possible to communicate between C++ and < Flash 8. Not as trivial, but it's possible with setvar().

It would be useful to cater for backwards compatibility, because then you can target a wider set of users. I can't imagine many C++ developers will have the latest copy of Flash.

This might be of interest:

http://www.macromedia.com/devnet/mx/...s/flash_vb.pdf

Either way it depends how much hassle it is. Doesn't affect me personally, but I'm just speaking for anyone with an older version of Flash that might want to use Hikari.
User avatar
ajs15822
OGRE Expert User
OGRE Expert User
Posts: 570
Joined: Mon Jan 02, 2006 2:05 am
Location: Texas
x 2
Contact:

Post by ajs15822 »

Well, I intend to implement setting the values of ActionScript variables at runtime and, to ensure more compatibility with older versions, I could also implement support for FSCommand as an alternative to ExternalInterface.call (although, of course, FSCommand would only allow users to pass a single argument at max).
Sweenie
Silver Sponsor
Silver Sponsor
Posts: 92
Joined: Wed Mar 23, 2005 3:29 pm
Location: Sweden
x 1

Post by Sweenie »

Anyone know of any good flash editor(with AS support)?

Found FlashDevelop but I was more thinking about some kind of visual designer.
Adobe CS3 is way too expensive for me.
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10
Contact:

Post by DanielSefton »

Sweenie wrote:Anyone know of any good flash editor(with AS support)?

Found FlashDevelop but I was more thinking about some kind of visual designer.
Adobe CS3 is way too expensive for me.
There's quite a few around the web, but your never going to find a complete IDE.

You could try a few apps at:

http://www.osflash.org/open_source_flash_projects

If you want the best alternitave to Flash, try SwishMax. It's actually pretty good, and much cheaper at $150:

http://www.swishzone.com/

Otherwise, just download the trial of Flash, and complete your GUI within 30 days. :P
User avatar
Nauk
Gnoll
Posts: 653
Joined: Thu May 11, 2006 9:12 pm
Location: Bavaria
x 36
Contact:

Post by Nauk »

wow another successful AJ-coup, totally cool :)
User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 605
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 16
Contact:

Post by AshMcConnell »

If you want the best alternitave to Flash, try SwishMax. It's actually pretty good, and much cheaper at $150:

http://www.swishzone.com/
That's pretty interesting. Can you use actionscript (written externally in flashdevelop for example) with SwishMax? If not, is there any "front end" to create flash UIs that do use actionscipt 3? I quite like it as a language, seems to work nicely.

I will read a bit more about it, but thought you might know :)

All the best,
Ash
Last edited by AshMcConnell on Thu Jun 12, 2008 12:00 pm, edited 1 time in total.
liyu
Gnoblar
Posts: 14
Joined: Sun Jul 30, 2006 5:50 am

Post by liyu »

wow, this is really cool, thanks for the share! however, it seems the text will be wrong when input text use ime(input method for some language, chinese eg). Does anybody occured this?
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10
Contact:

Post by DanielSefton »

AshMcConnell wrote:That's pretty interesting. Can you use actionscript (written externally in flashdevelop for example) with SwishMax? If not, is there any "front end" to create flash UIs that do use actionscipt 3? I quite like it as a language, seems to work nicely.
Unfortunately SwishMax doesn't support AS3. It usually takes a couple of years after the release of a language to have it ported into third party products. But SwishMax is a full IDE - it's got everything you need, if not more than what Flash itself offers. Whether or not it will work perfectly with Hikari is another question. Download the trial to see what it's like.
Murphy
Greenskin
Posts: 102
Joined: Tue May 10, 2005 11:42 pm
Location: SF, California
Contact:

Post by Murphy »

We used Hikari to create a Mini Map. It worked out pretty well I think. Check it out here:
http://nimblebit.blogspot.com/2008/06/m ... yment.html
User avatar
ajs15822
OGRE Expert User
OGRE Expert User
Posts: 570
Joined: Mon Jan 02, 2006 2:05 am
Location: Texas
x 2
Contact:

Post by ajs15822 »

liyu wrote:wow, this is really cool, thanks for the share! however, it seems the text will be wrong when input text use ime(input method for some language, chinese eg). Does anybody occured this?
Yeah, I can confirm the issue-- I'll see what I can do about getting IME to work in a windowless OLE context.
Murphy wrote:We used Hikari to create a Mini Map. It worked out pretty well I think. Check it out here:
http://nimblebit.blogspot.com/2008/06/m ... yment.html
Wooo, that is definitely kick-ass! :D It's even more amazing how quick yall rolled that out; thanks for being such eager guinea pi--er, alpha testers!
voxel
Gnome
Posts: 334
Joined: Wed Aug 02, 2006 9:27 am
Location: Toronto, Canada

Post by voxel »

Looks fantastic. Great work!

I'd love to see more exotic examples (render to texture and inter-SWF/C++ communication) to get a sense of the full power of it. My Flash knowledge is very low.
User avatar
Brocan
Orc
Posts: 441
Joined: Tue Aug 01, 2006 1:43 am
Location: Spain!!
x 8

Post by Brocan »

Murphy wrote:We used Hikari to create a Mini Map. It worked out pretty well I think. Check it out here:
http://nimblebit.blogspot.com/2008/06/m ... yment.html
Great ! :D :D :D
User avatar
Zeal
Ogre Magi
Posts: 1260
Joined: Mon Aug 07, 2006 6:16 am
Location: Colorado Springs, CO USA

Post by Zeal »

Anyone know of any good flash support forums? I need somewhere to ask my noob questions (I have lots of those).

*for example, does anyone know if its possible to add padding to your movieclips/buttons? So you can make nice evenly spaced guis, ect... (using flash cs3)
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10
Contact:

Post by DanielSefton »

Zeal wrote:*for example, does anyone know if its possible to add padding to your movieclips/buttons? So you can make nice evenly spaced guis, ect... (using flash cs3)
Nah, but you can turn the alignment grid on: "View -> Grid -> Show Grid". It's easy to neatly organize your movieclips, because it also has a 'magnet' feature which snaps to the position of surrounding movieclips e.g. if you want to line them up. The only annoying thing is that the pixels go into decimals, and me being a perfectionist, I can't stand it when it jumps to 100.9 or 17.3. :P
Anyone know of any good flash support forums? I need somewhere to ask my noob questions (I have lots of those).
There's plenty of them. Although, if you have a problem, just search Google, because Flash has such a huge userbase, that almost every single problem is guaranteed to have already been asked. :)

flashkit.com, kirupa.com and actionscript.org are the major ones.

Or just ask here, and I'll try to help - that's if ajs doesn't mind. :?
Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
x 1
Contact:

Post by Vectrex »

http://proto.layer51.com/ for all your scripting needs. Avoid any AS1 stuff though
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10
Contact:

Post by DanielSefton »

I've just about finished the prototype of my GUI. Took me quite a few days, but also because I prefer to code everything manually in AS, including the animations. It's far more efficient that way. Goodness though, if I had used CEGUI, it would have taken me years to achieve the same result. :shock:

Again, it's just a prototype. It's nowhere near finished.

http://www.openracer.org/images/gui1.jpg
http://www.openracer.org/images/gui2.jpg

Cheers ajs for such an excellent library. Who needs Scaleform? :D
voxel
Gnome
Posts: 334
Joined: Wed Aug 02, 2006 9:27 am
Location: Toronto, Canada

Post by voxel »

It integrates well with my sample framework except for one minor thing:

Code: Select all

const RenderTarget::FrameStats& stats = renderWin->getStatistics();
fps->callFunction("setFPS", Args((int)stats.lastFPS));
crashes in OGRE's UTFString _cleanBuffer() call which means the string is being deallocated (weird). I changed it to dynamic allocation, which is horrible and hacky, but it stops throwing an exception:

Code: Select all

Ogre::DisplayString* f = new Ogre::DisplayString("setFPS");
fps->callFunction(*f, Args((int)stats.lastFPS));
I suspect this is to due how callFunction() is implemented.

Framework/code is available:

http://www.casuallyhardcore.com/free/Si ... Hikari.zip
User avatar
Zeal
Ogre Magi
Posts: 1260
Joined: Mon Aug 07, 2006 6:16 am
Location: Colorado Springs, CO USA

Post by Zeal »

it also has a 'magnet' feature which snaps to the position of surrounding movieclips
Yeah I am using the magnet feature to ALLIGN all my movieclips (using mostly the built in as3.0 windows gui components). The problem is, everything is so bunched together, I want to add some padding between everything (like 3-4pix).

I suppose I could write a script that goes through all the movieclips and adjusts their position, but I was hoping there was some built in 'padding' feature.
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10
Contact:

Post by DanielSefton »

Zeal wrote:I suppose I could write a script that goes through all the movieclips and adjusts their position, but I was hoping there was some built in 'padding' feature.
That's what the grid is for. But if all else fails, you can easily do the basic maths to space them out ([x/y]+[movieclip width/height]+[spacing]). You don't need to write a script. That's why I always have a calculator handy, it's quicker to enter the position manually. :wink:
User avatar
ajs15822
OGRE Expert User
OGRE Expert User
Posts: 570
Joined: Mon Jan 02, 2006 2:05 am
Location: Texas
x 2
Contact:

Post by ajs15822 »

DanielSefton wrote:I've just about finished the prototype of my GUI. Took me quite a few days, but also because I prefer to code everything manually in AS, including the animations. It's far more efficient that way. Goodness though, if I had used CEGUI, it would have taken me years to achieve the same result. :shock:

Again, it's just a prototype. It's nowhere near finished.

http://www.openracer.org/images/gui1.jpg
http://www.openracer.org/images/gui2.jpg

Cheers ajs for such an excellent library. Who needs Scaleform? :D
I really like the simplicity of the composition, great prototype!

You're welcome~. :D
voxel wrote:It integrates well with my sample framework except for one minor thing:

Code: Select all

const RenderTarget::FrameStats& stats = renderWin->getStatistics();
fps->callFunction("setFPS", Args((int)stats.lastFPS));
crashes in OGRE's UTFString _cleanBuffer() call which means the string is being deallocated (weird). I changed it to dynamic allocation, which is horrible and hacky, but it stops throwing an exception:

Code: Select all

Ogre::DisplayString* f = new Ogre::DisplayString("setFPS");
fps->callFunction(*f, Args((int)stats.lastFPS));
I suspect this is to due how callFunction() is implemented.

Framework/code is available:

http://www.casuallyhardcore.com/free/Si ... Hikari.zip
My, how weird-- I was able to reproduce the bug using your exact frameworking code but the HikariDemo shows no symptoms of this.

I think what's happening with Ogre::DisplayString is that when I make the conversion to a std::wstring, it messes with the state of its internal buffers, a quick look at the Ogre source code finds this:

Code: Select all

// Ogre::DisplayString::_getBufferWStr, found at line 2220 of ogreutfstring.h
void _getBufferWStr() const {
	if ( m_bufferType != bt_wstring ) {
		_cleanBuffer();
		m_buffer.mWStrBuffer = new std::wstring();
		m_bufferType = bt_wstring;
	}
	m_buffer.mWStrBuffer->clear();
}
This internal member function is declared as "const" but it plainly has the potential to destroy/new its internal wide-string buffer and change the buffer type-- which sorta violates the whole "constant reference" agreement and is, what I suspect, the cause of the heap corruption errors at destruction.

As theorized, changing the first parameter of FlashControl::callFunction to "Ogre::DisplayString" instead of "const Ogre::DisplayString&" eradicated the issue. I'll integrate this short-term fix in the next iteration but I'd really like to ultimately get this issue confirmed/fixed in the Ogre source.
User avatar
ajs15822
OGRE Expert User
OGRE Expert User
Posts: 570
Joined: Mon Jan 02, 2006 2:05 am
Location: Texas
x 2
Contact:

Post by ajs15822 »

Revision 9 is in the SVN trunk, here's the summary of recent changes:
API Changes:
- In FlashControl:
-- FlashControl::getName has been added
-- FlashControl::getExtents has been added
-- FlashControl::setDraggable has been added

Core Changes:
- FlashValue now supports value-type interpretation
- Removed dependency upon shlwapi.

Bugfixes:
- FlashControl overlays weren't being sorted correctly by z-order during focus, this has been fixed.
- Patched up a memory leak in FlashControl, thanks to Adis.
- Applied a potential workaround for heap corruption due to Ogre::DisplayString in FlashControl::callFunction.
The only change that I think needs more clarification is the FlashValue value-type interpretation. Here's the story: I was debating with myself whether or not to add the ability to do runtime-type-checking (to ensure that a certain parameter is of a certain type) but decided not to implement this just yet due to implementation and usage concerns. As a compromise, I instead implemented flexible type-conversion in the FlashValue::getWhatever member functions so that users could work with the value regardless of its internal representation.
User avatar
ibito
Gnoblar
Posts: 5
Joined: Mon Oct 03, 2005 8:08 am

Post by ibito »

Hi, I'm new to Ogre and Ogre forums too, just for curiosity, I was wondering if this flash thing (hikari) can be added for example, to a face of a cube (or any other entity) or it's just for GUI purpouses... I don't know if this was asked before (haven't read all the pages of the post).
I think it's a good idea :D

Sorry about my english :oops:
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10
Contact:

Post by DanielSefton »

Thanks for the update. :)
FlashControl::setDraggable has been added
Yay! :D
I was wondering if this flash thing (hikari) can be added for example, to a face of a cube (or any other entity) or it's just for GUI purpouses...
I believe it can be added to 3D objects, yes. You can use render to texture to apply it to the face of a cube. I'm sure ajs can explain further if you need more info.
User avatar
ibito
Gnoblar
Posts: 5
Joined: Mon Oct 03, 2005 8:08 am

Post by ibito »

By the way, I didn't say what I think about this project, it is awesome!.
:D :D :D :D
User avatar
ajs15822
OGRE Expert User
OGRE Expert User
Posts: 570
Joined: Mon Jan 02, 2006 2:05 am
Location: Texas
x 2
Contact:

Post by ajs15822 »

ibito wrote:Hi, I'm new to Ogre and Ogre forums too, just for curiosity, I was wondering if this flash thing (hikari) can be added for example, to a face of a cube (or any other entity) or it's just for GUI purpouses... I don't know if this was asked before (haven't read all the pages of the post).
I think it's a good idea :D

Sorry about my english :oops:
Sure, you can create a "FlashControl" in Hikari two ways:
- As a viewport overlay (a movable rectangle aligned to the screen)
- As an Ogre Material (that you can apply to any mesh or entity)

Here's an example using HikariManager::createFlashMaterial (see Hikari.h for the API):

Code: Select all

FlashControl* myControl = hikariMgr->createFlashMaterial("myControl", 420, 375);
myControl->load("myMovie.swf");

myEntity->setMaterialName(myControl->getMaterialName());
Just be aware that you will need to handle mouse-picking yourself and subsequently inject localized mouse events and set keyboard focus directly using the FlashControl interface.
Post Reply