How to draw the game in a specific portion of a game window - xna

Game Frame
I am stumped as to how I should go about only drawing the game in the transparent area of the game gui/border. Would I use viewports or something else?
(I have included a sample of the border/gui I plan to use)

Related

Unity ARKit automatically positions terrain on startup

I just started learning ARKit with Unity. I've downloaded SDK from Asset store, imported it, opened demo scene and added a terrain. I've added it under HitCubeParent as a child:
http://shrani.si/f/40/UP/1q7QqoFl/1/capture.jpg
I've added a Unity AR Hit Test Example Script on a terrain and linked HitCubeParent to it:
http://shrani.si/f/6/133/3w5sasQA/1/capture1.jpg
When I build a game on iPhone, ARKit is working, but one thing that bothers me is that terrain is positioned automatically when scene starts (even though i don't tap on the screen). It causes bad positioning like terrain floating in the air or similar issues. I would like to modify the kit so when the scene starts, only generated blue plane is visible. User should then adjust the position of a plane to a table or similar flat surface and tap on the screen to position the terrain on that plane.
Like this:
https://www.youtube.com/watch?v=OCzuNnejwy4
Any good tutorials on this ? I've searched a lot but couldn't find anything usefull.
Disable the Terrain and enable it after the first successful ARHitTestResult. See line 68 in UnityARHitTestExample.cs:
if (HitTestWithResultType (point, resultType))
{
return;
}
This is actually confusing since this HitTest method actually positions the m_HitTransform and is not merely a test.
In this if block you could enable your terrain, after you disabled it in the Awake method.

SpriteKit Racing top down Game

I want to write a simple top down racing game for iOS. I want to use Sprite Kit instead Cocos2D , I'm new to game development and I have a question:
How can I create the race tracks? What I think is: One single big background image for each track and a car that moves over it and remains inside the track by interaction with a path. The path is inserted by a coordinate system in the level code and represents the "borders" of the road.
Is this a good way to start a top down racing game? Or are there better ways? How can I "draw" the path over my background image?
You can use "Tiled Map Editor" http://www.mapeditor.org/ to create your maps. I'm thinking you'll only need a few unique tiles, one for straight track, one for grass, one for curved track, maybe some trees, etc.
As for the path, you can try to use an polygonal edge physics body? And then move the car to where the user touches on the screen. if the user tries to move the car outside, the car will bump against the physics body of the edge.

Viewport a la Angry Birds?

Not sure if that's the right name for it, but I'm looking for a way to implement zooming in my game.
Essentially the game should zoom in on my character during the moving and shooting phase (its like Worms), but zoom out when the character has shot (preferably by following the shot, like Angry Birds does).
Can Corona/Lua do something like this?
Everything should be in a display group and you can run transitions to scale the group. Something like:
transition.to(gameGroup,{time=500, xScale = 2.0, yScale=2.0})
to zoom in. You should also research cameras to help keep your player centered on the screen.

Lime for Corona SDK - Camera focus on layer

Is there any solution for setting up focus on layer in Lime framework.
I would like to use this on game called "keepie uppie" with scrolling background (camera).
When you hit the ball the entire frame together with a ball and tennis racket moves up.
The figure below shows how I would like to make it work:
Check out the Camera from Lime. It basically creates a display group and moves everything relative to that. You can focus the camera on one of your game objects. The github repo includes an example of doing just that.
https://github.com/GrahamRanson/Camera

(Follow-up question) How to make a 2D camera that follows a sprite? [for XNA-game]

I was looking for tutorials on the net for a 2d camera that follows a sprite and I found a reply from this site:
(XNA 2D Camera Engine That Follows Sprite)
I made a simple game where in the sprite is loaded at the center of the game screen and it moves according to the direction I press from my directional key pad.
I tried implementing this code and added the Spritebatch instruction to my game. There seem to be no syntax error, but once I run the game, I only see the blue screen. Also, the sprite I used didn't appear.
(I'd like to imitate the player control of Tasty Planet where in the goo is controlled by the mouse and the screen follows it around. - trailer of the game: http://www.youtube.com/watch?v=az4VgetA_n0
Game development is sometimes best accomplished step by step. Especially when one is first learning :-)
What you want to do is first get some basics onto the screen 1) the player's avatar, and b) some static component like a wall, or floor.
With those in place and rendering on the screen, then you implement your camera component. This will be a class that takes the player's position in the world and offsets any "world" item by that much.
For example, if the player is at 10,10 in the world, and there is a tree at 5,5 ... the tree should be drawn at -5,-5, and the player drawn at 0,0 (assuming your coordinate grid's 0,0 is in the middle of the screen). And as the player's position moves, just subtract that from static world object that you draw.

Resources