Hello again!
I'd like to implement map dragging so that the player can have a look around on the map (similar to FarmVille). Is the panView method the only way to accomplish that? And if so, is it possible to eliminate the flashing so that a continuous map dragging can be achieved?
Drag map
I don't think dragging the map with the mouse can be achieved. During panning, the engine adds/removes tiles to/from the stage: doing this live, while the user moves the mouse, would hit the performance considerably.
About the "flash" effect during panning, just pass showAnimation=true to the OpenSpace.panView method (fourth parameter): map will pan smoothly, without "jumping" to the new position showing the flash effect.
About the "flash" effect during panning, just pass showAnimation=true to the OpenSpace.panView method (fourth parameter): map will pan smoothly, without "jumping" to the new position showing the flash effect.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
If I call the panView method like this (_openSpace is my valid OpenSpace 2 instance), I immediately get an error as follots
Code: Select all
_openSpace.panView(100, 100, false, false);
Exception fault: ArgumentError: Error #2025: Das angegebene DisplayObject muss ein untergeordnetes Element des Aufrufers sein.
at flash.display::DisplayObjectContainer/removeChild()
at com.smartfoxserver.openspace.engine.control.map::EngineMapRenderer/onTransitionEffectComplete()
[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer/OpenSpace/Client/Classes/src/com/smartfoxserver/openspace/engine/control/map/EngineMapRenderer.as:1060]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.greensock::TweenMax/complete()[/Users/benjaminbischoff/Documents/Workspace/Presentation2/libsrc/com/greensock/TweenMax.as:778]
at com.greensock::TweenMax/renderTime()[/Users/benjaminbischoff/Documents/Workspace/Presentation2/libsrc/com/greensock/TweenMax.as:757]
at com.greensock.core::SimpleTimeline/renderTime()[/Users/benjaminbischoff/Documents/Workspace/Presentation2/libsrc/com/greensock/core/SimpleTimeline.as:74]
at com.greensock::TweenLite$/updateAll()[/Users/benjaminbischoff/Documents/Workspace/Presentation2/libsrc/com/greensock/TweenLite.as:616]
We tested this, both in Flash and Flex, and no error is thrown.
There must be something else going on.
What about the example we provided? Did you test it? Same error?
It seems you are using Greensock's Tween classes. They are contained in the OpenSpace package too... maybe there's some kind of incompatibility? Try using the classes from the OpenSpace package.
There must be something else going on.
What about the example we provided? Did you test it? Same error?
It seems you are using Greensock's Tween classes. They are contained in the OpenSpace package too... maybe there's some kind of incompatibility? Try using the classes from the OpenSpace package.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
I actually would like to implement a pan where I just move the Openspace component. I'm working with a very small map, so I don't really need Opensapce to delete tiles.
One of the issues I'm having with this though, is that the user needs to be able to pan while in edit mode, but I don't want the user to be able to do this while the user is moving around furniture. Is there any event that will let me know when the user is moving around furniture within Openspace? I tried using the "onItemClicked" handler, but that only seems to go off when you click on it and not when you drag the item.
One of the issues I'm having with this though, is that the user needs to be able to pan while in edit mode, but I don't want the user to be able to do this while the user is moving around furniture. Is there any event that will let me know when the user is moving around furniture within Openspace? I tried using the "onItemClicked" handler, but that only seems to go off when you click on it and not when you drag the item.
Return to “OpenSpace v2 discussions and help”
Who is online
Users browsing this forum: No registered users and 32 guests