Hello,
I would like to display an image map with a few arrows on top. I want to move the ends of these arrows with the mouse. Basically I would like to be able to set position and direction of multiple arrows. I can display an image using StaticImage. I can track the mouse presses on the static image. Should I modify the texture of the static image to draw arrows and keep track of the selected tip? Maybe there is an easier way to do that?
Thank you.
Arrows on a image - widget
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Arrows on a image - widget
Hi,
In the current releases I think updating the source texture is the way to go here, though obviously that can be complicated depending upon your point of view.
It's possible in future releases - from 0.7.0 onwards - that this could be done more easily with just CEGUI, by perhaps create a simple custom widget that would have a collection of the 'arrow' images each which had position and orientation.
So yeah, for now, I think manually updating the texture.
CE.
In the current releases I think updating the source texture is the way to go here, though obviously that can be complicated depending upon your point of view.
It's possible in future releases - from 0.7.0 onwards - that this could be done more easily with just CEGUI, by perhaps create a simple custom widget that would have a collection of the 'arrow' images each which had position and orientation.
So yeah, for now, I think manually updating the texture.
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: Arrows on a image - widget
Thanks, CE. I thought I have seen a widget that allowed selection of the color by clicking on the color plane in the widget, similar to standard color selection dialogs. I can not find it again. Am I imagining things?
Thanks.
Thanks.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Arrows on a image - widget
I also have a vague recollection of something similar posted here, although a quick search didn't show anything particularly directly useful. I did find posts from people that mentioned their colour selectors (Evak, daves), not sure if their code is available though.
CE.
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: Arrows on a image - widget
Hello, a simple question. How do I trap mouse events over a static image? I would like to capture right and left mouse clicks. Ideally I would like to do it the same way as the subscription to button clicks:
StaticImage is not a class. I see that it is based off the DefautlWindow type, which is GUISheet class, which is Window class. Theoretically I can use:
But that would give me the subscription to all window events... How can I narrow it down to a specific window? Should I simply check the source of event in my subscriber?
Thanks.
Code: Select all
CEGUI::GlobalEventSet::getSingleton().subscribeEvent(
CEGUI::StaticImage::EventNamespace + "/" + CEGUI::StaticImage::LeftMouseClick,
CEGUI::Event::Subscriber(&SomethingTodo));
StaticImage is not a class. I see that it is based off the DefautlWindow type, which is GUISheet class, which is Window class. Theoretically I can use:
Code: Select all
CEGUI::GlobalEventSet::getSingleton().subscribeEvent(
CEGUI::Window::EventNamespace + "/" + CEGUI::Window::EventMouseButtonDown,
CEGUI::Event::Subscriber(&SomethingTodo));
But that would give me the subscription to all window events... How can I narrow it down to a specific window? Should I simply check the source of event in my subscriber?
Thanks.
Re: Arrows on a image - widget
When I use CEGUI::Window::EventNamespace then my events for button presses are masked (subscriber to CEGUI::PushButton::EventClicked is not called any more). How can I help that?
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Arrows on a image - widget
In answer to the part about only caring about one particular subclass, then yes, you should test the source class in your handler.
With regards to the issue about 'higher level' events being inhibited, I can't explain that, since there's nothing in the code that could cause that as far as I know.
CE.
With regards to the issue about 'higher level' events being inhibited, I can't explain that, since there's nothing in the code that could cause that as far as I know.
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: Arrows on a image - widget
Thanks CE.
I also noticed that when use global subscription to the ButtonDown events, mouse events stop being processed properly for the top windows. For example when I show a window I have to click on it before the buttons on this window show tooltips when mouse hovers over them. If I click on a button that shows a different gui window everything works fine, but if I click the button that hides current window, then when I show this window again, only the previously pressed button stays focused and clicks anywhere trigger that button. Obviously I'm the one who triggers the events, but the name of the triggered window is not set properly in the EventArgs. If I comment out the global event subscription to the ButtonDown everything works as required, but I do not know when mouse clicks the static image.
Can I somehow specifically subscribe to the button presses on static image?
Thanks.
I also noticed that when use global subscription to the ButtonDown events, mouse events stop being processed properly for the top windows. For example when I show a window I have to click on it before the buttons on this window show tooltips when mouse hovers over them. If I click on a button that shows a different gui window everything works fine, but if I click the button that hides current window, then when I show this window again, only the previously pressed button stays focused and clicks anywhere trigger that button. Obviously I'm the one who triggers the events, but the name of the triggered window is not set properly in the EventArgs. If I comment out the global event subscription to the ButtonDown everything works as required, but I do not know when mouse clicks the static image.
Can I somehow specifically subscribe to the button presses on static image?
Thanks.
Re: Arrows on a image - widget
I found out that if I subscribe to the events from a particular window then I do not have the issues described above.
Code: Select all
CEGUI::WindowManager::getSingleton().getWindow(MyStaticImageWindowName)->subscribeEvent(
CEGUI::Window::EventMouseButtonDown,
CEGUI::Event::Subscriber(&CCeguiGUI::WindowClicked, this));
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 8 guests