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 want to simulate mouse clicks for my opencv project in C++. I am using mouse_event(), and I do not understand the meaning of the dx and dy parameters when sending MOUSEEVENTF_LEFTDOWN events.
Are the terms "absolute" and "relative" used in documentation related to screen or cursor?
The dx and dy parameters can refer to either absolute or relative coordinates.
If you don't want the mouse to move, set them both to 0 and make sure you don't set the MOUSEEVENTF_ABSOLUTE flag (that is; you need to use relative coordinates, since adding 0 to the existing position results in no change).
Also note that mouse_event is deprecated; you should be using SendInput instead.
Related
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 months ago.
Improve this question
Unity 3d has two viewpoints, one is game and another isscene. when you move objects in scene you can see changes happened in game in the same time. while the reverse is true. But UE4 doesn't have this function. So I wonder if I can develop a plugin for UE4 to achieve that? does anyone have a clue?
enter image description here
Unreal 4: Go to Window -> Viewport 2. Drag the window somewhere and you will have 2 viewports:
Press play, only one viewport will display the "gameview" and the other remains as "sceneview" - Moving stuff in the 2nd Viewport will not update the game!
But I found this plugin:
https://github.com/jackknobel/GameViewportSync
You can see if that works for you or use it as a reference to get started developing your own plugin.
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 7 years ago.
Improve this question
I am creating this game in Visual Studio for my school project using SFML to render and create sprite.
I have created this button which I currently places at
x=1000, y = 600 on my screen size.
I have retina display macbook.
I tested the position of the button and it changes it's location depending on the screen size. if the screen size is something smaller then my x and y then button would not even show on the screen so how would i make it dynamic for all the different screens and how can i make it scale to the same size in different sizes.
thanks,
Start with sf::VideoMode::GetDesktopMode() to determine the size of the desktop you're running on and divide/multiply your button coordinates appropriately. You could also approach the scaling problem with sf::Views - http://www.sfml-dev.org/tutorials/2.2/graphics-view.php
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I was fixing an issue to do with scaling and the solution was that we had to call SelectFont afer DrawText.
If SelectFont is called before DrawText the font isn't scaled correctly.
I cant see how that would make a difference, is there any reason?
SelectFont essentially selects a font in the Device Context you pass in. If you call DrawText before selecting a font, then a default font (System) will be used and not the font you want to select.
This means that the font you are using isn't scaling well as the results seem better with the default system font.
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 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.