I have become a bit obsessed with making a good game in the vb.net console and have recently tried drawing to part of the buffer not on the screen then moving the screen (with console.WindowLeft) to that position that was now written on, in order to stop flicker (or shimmer if you overwrite from cursor position 0,0). Unfortunately when you set the cursor off the screen, somewhere else on the buffer, it drags the screen with it so that you can see what is being drawn/written.
I was wondering if anyone had an idea of how I could get around this or if there are other ways of accomplishing the same thing (e.g. if it is possible to make a double buffer?)
Related
I created a blank template and added a landscape.
When I simulate the project, I can look around with the mouse, but as soon as I move with WASD, I am instantly below the landscape. It doesn't fall, so it doesn't appear to be a gravity-related issue, I'm just down there all of a sudden.
Does anyone have any idea what I could have done wrong?
I've not altered any blueprints as far as I'm aware.
Without watching the code is hard to understand what is wrong,but check this:
In the code/blueprint check that when you press input the position is correctly Set (should be like current position + offset based on direction)
Check if your input event is used somewhere else (maybe some uknown behaviour is executed)
I am a numpty. I didn't realise I was working on a map where I'd added a sphere as my sky box, and the collision was turned on, so any movement instantly jumped me down below the bounds of the sphere. Thanks.
I'm making... well, it's sort of like a game in VB.net (using VS2008, if it matters). Being sort of like a game, it's dependent on timing, but it also has a large area (have to scroll the window on pretty much any resolution).
The problem I'm having is that whenever I scroll the window (or move any of the smaller, additional windows) the program pauses what it's doing, and doesn't start again until I stop scrolling (or moving windows, or whatever).
I hate to sound picky, but the program keeping track of how much time it's lost and making it up for it when you're finished scrolling isn't going to cut it.
So is there any way to stop it pausing when you scroll or move windows? Thanks for your answers.
Essentially, you can’t (reliably). Don’t use scroll controls, or in fact any controls at all. It’s a common beginners’ error to use multiple controls in a game.
Render all your game in one PictureBox control and scroll that using e.g. the ScrollDC Windows API function, or by building up the graphic incrementally as the user scrolls. This is more difficult but also usually more efficient since you only need to draw a smaller area (i.e. the visible area, and nothing more).
If that’s not fast enough, chances are that GDI+ graphics won’t cut it and you need to resort to DirectX/XNA.
I have a situation in which I ask and get a double-buffering OpenGL context, but when I draw in it, both the front and back buffer are affected. The draw buffer is set to the back buffer (And only the back buffer). If I look in OpenGL Profiler, I do see all that: the value for GL_DRAW_BUFFER (GL_BACK) and the actual back and front buffer being drawn to.
Since I'm working with an NSWindow that has a backing store, We do not see any of this happening on the screen. The problem is that I'm getting screenshots of this window with CGWindowListCreateImage. This function seems to be fetching the image from the front buffer, and not from the screen buffer (Wherever that is...). So the image returned is incomplete: it only contains the elements that are drawn at the moment it is grabbed, even if no flush has been called.
There is a utility in the mac developer package called Pixie. It basically grab the screen at the mouse position, and display it zoomed in so you can analyze it. This program has the same behavior than calling CGWindowListCreateImage: you can see incomplete images. So I guess the problem is not with the way I use CGWindowListCreateImage, but rather with my window or my display...
Also, It does not seems to happen all the time. Not every windows show this behavior, and even for a given window, it seems to come and go, especially if I move the window to a different screen (In a dual display).
Anyone faced this before?
Background: I recently got two monitors and want a way to move the focused window to the other screen and vice versa. I've achieved this by using the Accessibility API. (Specifically, I get an AXUIElementRef that holds the AXUIElement associated with the focused window, then I set the NSAccessibilityPositionAttribute value to move the window.
I have this working almost exactly the way I want it to, except I want to animate the movement of windows. I thought that if I could get the NSWindow somehow, I could get its layer and use CoreAnimation to animate the window movement.
Unfortunately, I found out that this isn't possible. (Correct me I'm wrong though -- if there's a way to do it this way it'd be great!) So I'm asking you all for help. How should I go about animating the movement of the focused window, if I have access to the AXUIElementRef?
-R
--EDIT
I was able to get a crude animation going by creating a while loop and moving the position of the window by a small amount each time to make a successful animation. However, the results are pretty sub-par. As you can guess, it takes a lot of unnecessary processing power, and is still very choppy. There must be a better way.
The best possible way I can imagine would be to perform some hacky property comparison between the AXUIElement info values for the window and the info returned from the CGWindow api. Once you're able to ascertain what windows in the CGWindow API match AXUIElementRefs, you could grab bitmaps of the current window contents, overlay the screen with your own custom animation draw of the faux windows, then as you drop the overlay set the real AXUIElementRef's to the desired-end-animation positions.
Hacky, tho.
I have a problem not sure how to solve this. Hmm I am developing a game, a multi touch game, I already can make everything working fine, except a small issue that I want to show messages on the playing screen, each time the player makes actions. like his finger moves right the message says : "this finger moving right" nicely at the bottom of the screen, then if the finger move left, then it says the his finger moves left... something like that, can anyone show me how. I am using Cocos2D , it shall be much easier in Cocoa.
Thanks a alot for any help.
You'll probably need to be more specific with your question, but for now, here's a general answer:
Handling touch events on the iPhone and Handling touch ("trackpad") events on the Mac.
You'll receive and process the events per the above, then you'll display the results somehow. For testing, you'll probably just want to log the results to the console. For the final version, you might have a label or even a custom view that draws the "instruction" in some fancier way. If the latter is the case, you'll want to read up on custom views and drawing for whichever platform you're using (or both).