Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I have a complex drawing on a Gtk DrawingArea widget and I wish to provide the user with a way to select a rectangle on it to expand for a closer view. I have managed to get the necessary mouse button events sorted out so that the rectangle can be selected, but it would be desirable to have the actual rectangle drawn on the display, moving around along with the mouse. I need to know how one does this without disturbing the underlying drawing (i.e. so I can erase the temporary rectangle as it changes size and shape without having to redraw the underlying picture).
Could someone tell me the correct name for this effect (so that I can google it) or does anyone know of an example, or a keyword to search the Gtk documentation?
Thank you.
You are looking for the Rubber Band technique.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I would like to create a window using open GL but i can't find any good tutorial, can anybody tell me one?
Once the window will be create, i want to insert a picture on it!
This isn't how openGL works (inserting pictures inside).
To draw a picture you will need to create a quad and then assign a texture to it.
For a tutorial, google Hello Triangle openGL then move from that point forward.
This question is aleready asked several times before. As MichaelCMS mentioned. This is not how OpenGL works. You can do this (creating a window and insert a picture) with Qt too.
See here, here or here.
Creating a window doesn't depend on OpenGL. You can use GLUT or the Qt Libarys to do this platform independent. There exist a lot of tutorials for this.
For a GLUT-tutorial, see here, here or here.
For a tutorial for Qt, see here. Qt offers a lot of own classes for a easier use of OpenGL too.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
How can I make zoomable square table like in the picture below?
At first, there is no tile in squares.
but when zoom in, tiles are slowly appearing inside squares.
And another question, can I have paint bucket tool and use to fill my tile then store information into array?
In SFML this can be done using a so-called sf::View. This allows you to have a world defined and have different and changing views on it, like in your example.
There is a very good introduction to Views in SFML here.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have seen a couple topics about this already but they were a bit vague for me so I decided to make this. I'm working on a little adventure game just for fun in Qt, its basically just text on the screen and the player inputs commands into a line edit widget which I then process and do the related action/event. Thing is, I am a little confused on how to approach this. I don't want to dig myself a hole by manually coding in lots of commands and events per room because it seems to just be a pain later on. So then I thought about using some sort of database to store the information but which one should I use? I would love some advice from people who have tried something similar.
And here, these pictures are a rough outline of what I am trying to do.
Flowchart of states
Level tiles
Edit: I should add, the tiles for the level basically work like this. The light gray is a direction the player can move in, the dark gray parts are walls and the colors are various different actions you can do.
I don't particularly care for code, but I would like suggestions on what tools to use for this and maybe how to set them up right. Someone must know.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
as the title says, I want to add my main window a banner in the bottom of the window that shows text that runs from left to right, just like you can see in your TV when watching fox/CNN...
I'm using QT 4.5.2
Thanks a lot :)
You have many options. You could:
Create a custom widget and override QWidget::paintEvent()
Drawing your text to an image and then repainting that image as often as needed
Creating a QGraphicsScene and then moving an appropriate text item around.
QTimeline and/or QTimer will likely be useful in your implementation. The key idea is that you need to draw something at different positions at consistent intervals. If you redraw frequently enough, it will look like an animation.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I am looking for a GUI toolkit that is easy to use and cross-platform. Another major requirement of the GUI is that it should support zoom and pan. For example, I should be able to zoom in on a picture and enlarge buttons.
Something like this:
http://eaglemode.sourceforge.net/video.html
But it should have Windows support also (which to the best of my knowledge Eagle Mode doesn't have).
From what I understand, QT is a good UI and it can draw right on top of the OGL window. I think it resets the matrix before drawing the buttons. If I can prevent that reset, the GUI can be zoomed along with the rest of the items. Is there a simple hack to do just that?
Thanks,
This is doable in Qt 4.4 and above using the Qt Graphics View Framework. It makes it very easy to make these types of interfaces, since Widgets can now be placed on the scene (QGraphicsScene) using QGraphicsWidget and QGraphicsLayout.
The framework supports zooming, panning, rotating, etc - with animation.
Take a look at Piccolo2D, which has Java and .NET bindings.
It is the successor of Pad++, which was well ahead of its time: