The tag has no usage guidance.

learn more… | top users | synonyms

2
votes
1answer
39 views

Viewport and Camera setting

For my first game in LibGDX and Android I got a Problem: I have a background picture which is 2560px * 720px. The screen is 1280 * 720. How do I have to set the viewport and camera in order to get ...
0
votes
1answer
25 views

Viewport and debug session

I define and set viewport using this piece of code: D3D11_VIEWPORT viewport; viewport.Width = (FLOAT)pBspWindow->GetWidth(); viewport.Height = (FLOAT)pBspWindow->GetHeight(); viewport.TopLeftX ...
1
vote
1answer
26 views

LibGDX viewport touch coordinates transformation

I've been trying to get LibGDX's viewport and camera unproject() to work and so far none of the tutorials/answers I've found have worked for me. I have a game window of 840x480 units with ...
1
vote
0answers
21 views

Error in projecting coordinates from FitViewport to screen in LibGDX

i'm using a FitViewport to render my "game world". Viewport virtual dimensions are fixed 400x240. I use viewport.unproject method to scale input touches from screen coordinates to world coordinates, ...
1
vote
2answers
46 views

Best practice for scrollable viewport rendering

I am working on a tile based game that renders the playing surface in a viewport. I am struggling with getting my head around the mechanics and best practices of rendering a viewport, specifically a ...
3
votes
1answer
91 views

How do I use Libgdx viewport for UI?

I am using LibGDX to make a game for Android and I am using 2 Viewports. One for UI and one for the actual game content. My problem is I can't find a good way to scale my UI using a Viewport. This ...
0
votes
1answer
77 views

wrongly scaled on cocos2dx 3.2 when render to multiple fbo (more > 1 deep)?

i have bug that only happen when retina flag disabled. i try draw multiple render texture to achive some multi post effect: so i have 3 render texture, fbo 1 for final pos effect fbo 2 for back ...
1
vote
1answer
52 views

Why value 1 in OrthographicCamera viewPort width?

So, I read that camera = new OrthographicCamera(1, h/w); creates a camera with an appropriate width and height for the field view.. However, I can't understand that value 1 for the viewport width, ...
1
vote
2answers
77 views

How can I calculate the orthographic projection needed to encompass an object with arbitrary rotation?

So I need to set up the dimensions of a orthographic projection that will encompass the entirety of a bounding box when viewed from any arbitrary position. That's an eye (programmer art); and the ...
0
votes
1answer
75 views

Relationship between Camera's view size, screen resolution and objects scale

I've had this question since a long time ago and wanted to know the relationship between how an object is viewed through the camera depending on the resolution of the device, the camera's view size ...
0
votes
0answers
28 views

2D viewport matrix World to Local coordinates

I would like to use a Matrix but it causes (or I think it does) problems with accuracy. Clearly classic float matrix causes jaggy movement/accuracy issues. The reason is that my objects have real ...
3
votes
2answers
316 views

How to change mobile device screen size in Unity for testing?

For an experiment I need to be able to dynamically adjust the screen size of my device. I'm using a Nexus 5 (5") and want to fake the screensize to 2", 3", 4",.. See images: Is this possible ...
1
vote
1answer
61 views

OrthographicCamera and viewport not giving expected effect

I recently asked a question about this area that I think was too broad, so I will try a new approach. I have the following code I am experimenting with: batch = new SpriteBatch(); ...
0
votes
1answer
304 views

How do I destroy a Unity prefab when it goes off-screen?

I made an infinite path using prefab.Path moving in the negative x direction. I want to destroy the path clone once it goes offscreen. My path move script is: var Speed:float = 5; var ...
1
vote
2answers
143 views

How can I run a Unity game in a window larger than the desktop resolution?

I am exploring a research problem using Unity. I require a game resolution of at least 4096 x 786. There seems to be no option under build settings for setting a fixed screen size window. (The default ...
0
votes
1answer
163 views

OpenGL Viewport inside of a Viewport

I'm creating a labyrinth in opengl, and I'm trying to create a minimap. For that, I thought of creating a viewport inside of a viewport. I already tried following a tutorial from Lazy Foo, and I can ...
1
vote
2answers
197 views

Is using camera and viewport in Libgdx always necessary?

I understand that camera and viewport are important to keep virtual measurement units and handle different aspect ratios and resolutions when building games with worlds bigger than the screen (e.g. ...
0
votes
2answers
163 views

How to setup glOrtho and Viewport [duplicate]

When setting up a window I set 6 variables in my render class int windowWidth; // the width of the window int windowHeight; //the height of the window int dimL; // the coordinate of ...
6
votes
4answers
342 views

Keeping sprites nice and pixelated

How do I keep the sprites in my game nicely pixelated on screens of all sizes and resolutions? I use nearest-neighbor texture filtering when resizing pixels, but this works well only at really high ...
1
vote
1answer
134 views

How can I use CCClippingNode to trim the top and bottom from a CCTableView?

I'm fairly new to Cocos2d and struggling with sizing a CCTableView. How can its height be controlled so that I have space at the top and the bottom? I'm trying to visually wrap the top and bottom of ...
2
votes
1answer
111 views

XNA: How do I match Spritebatch View/Projection Matrices with BasicEffect Matrices?

I'm rendering a bunch of 2D content using SpriteBatches to a default XNA viewport. A simple 2D camera is used to move around the scene, which generates a transformation matrix passed to each ...
0
votes
1answer
189 views

Isometric View of “Voxel-Style” Terrain

Suppose you have an arrangement of data for a terrain set up like this: terrain[layer][cart-x][cart-y]. Each location (ex. terrain[0][0][0] for the top left corner of the lowest layer) in the array ...
0
votes
0answers
30 views

Crafty Bind “createView” to viewport - TiledMapBuilder

Is there any way to bind the createView function to the player entity? For Example: I am moving forward and the map is automatically loaded. I call the Map with: Crafty.e("2D, DOM, ...
7
votes
2answers
251 views

How do I letterbox a C#/Monogame viewport within a resizeable window?

I am making a 2d game with xna/monogame. I want the main view area to always show 15x15 tiles, or 480x480px. I've got something that sort of works, following this guide. It expands the view range ...
1
vote
1answer
892 views

How can I prevent the viewport from stretching/distorting?

Basically, I want to know how I can remove distortion or stretching of the rendered image when the viewport/window size changes. The following images exemplify the distortion/stretching I'm talking ...
0
votes
1answer
45 views

transformation before the perspective divide but after projecting perspectively

My problem is that I would like to confine a scene render to a (possibly rotated) rectangle without using glViewport(). I don't want to use it to save, if possible, some cycles that would otherwise be ...
1
vote
2answers
166 views

XNA graphics.PreferredBackBufferWidth's new value doesn't immediately change window size

I set the width and height of the window in my game constructor, and then pass the graphics manager to a class to check the value. In the game's initialize function, it doesn't seem to recognize the ...
0
votes
0answers
226 views

Scaling issues with Open GL viewport / scissor box (Trying to draw outside of viewport)

In my game I am currently scaling the viewport so it retains the ratio of my development device like so: width = (int) Math.min(deviceWidth, deviceHeight * 1.702127659574468); //1.702127659574468 is ...
4
votes
3answers
4k views

Confusion over GLViewport

I'm hoping someone can help me understand the GLViewport and what happens when we resize it This will illustrate my confusion.... So, here I have a quad stuck in the middle of the screen. If I ...
1
vote
2answers
339 views

Keeping ratio the same across devices on fixed screen game

My game is an Android game using OpenGL ES 2.0 (But this question could apply to any platform). I have read many questions on here regarding ratio management, and also read many tutorials outside of ...
16
votes
2answers
1k views

Camera vs Viewport

I'm don't have a clear understanding of what precisely is the difference between the camera coordinates and the viewport coordinates. Can anyone please clarify?
0
votes
2answers
2k views

Libgdx detect when player is outside of screen

Im trying to learn libGDX (coming from XNA/MonoDevelop), and I'm making a super simple test game to get to know it better. I was wondering how to detect if the player sprite is outside of the screen ...
1
vote
0answers
145 views

Create multiple viewports in minecraft?

Im new to minecraft modding, but Im curious about the possibility of creating a mod such that players could set up a 'security camera' with its own viewport so that the player could 'see what the ...
1
vote
2answers
104 views

How do you account for zoom in a top down viewport?

I've been stumped on this for days so please forgive me if this question is in bad-form. I have a generic top-down RPG structure, and I want to create a zoomable Canvas viewport for it. I've read ...
1
vote
2answers
79 views

How can I make an AI agent avoid screen edges?

I'm programming an AI agent and I want them to avoid the screen edges. I've been considering using either the obstacle avoidance or the fleeing behaviour. Do either of these make sense? How should I ...
1
vote
0answers
163 views

How can I scroll an HTML table when the player drags near the screen edge? [closed]

I'm trying to make my Word Search game mobile friendly. I want to display a grid of letters on the user's phone. The letters must be big enough that the user can touch them individually. My problem ...
27
votes
6answers
4k views

Why don't all games permit changing the field of view?

This is less of a question aimed at developing a game and more about the technology behind it. A number of gaming journalists and pro gamers (both on the tournament and the home entertainment sector) ...
1
vote
1answer
85 views

How do I render into a sub-region of a texture atlas with XNA / HLSL?

Is it possible to render into a texture atlas? I've been wondering how to reduce the number of textures required for shadow-mapping, and came across a blog post here about rendering up to sixteen ...
0
votes
1answer
143 views

Changing the maxDepth of viewport

Whenever I change the maxDepth of the viewport from 1.0 to say 300.0f (just for kicks), everything on my screen disappears. Why is that? Is there anywhere else I have to account for this change in ...
4
votes
1answer
1k views

How do I ensure that perspective and orthographic projection matricies show objects at the same size on the screen?

I am working on a 3d scene editor and would like to show the scene in orthographic projection. My current problem is that I am not sure how to calculate the orthographic projection matrix such that ...
1
vote
3answers
148 views

Can I use a translate function to implement a viewport?

I read this great question and its accompanying great answer about rendering a viewport in a top down 2D game: As for actually drawing the objects the camera can "see", you now draw all objects ...
6
votes
4answers
452 views

Is a game view “stack” really a Stack?

Given the academic definition of a Stack as "A data structure where items are added in a FILO manner and accessed in such a way that only the top item may be examined or removed to be modified." Game ...
2
votes
2answers
301 views

Orthographic Zooming with 0,0 at top/left

I'm trying to implement zooming on my 2D game. Since it's using orthographic projection, I thought it would be easy to implement zooming. After looking around the internet, I found a bunch of ...
4
votes
1answer
197 views

Can you help me solve the paradox that has confused me about the glViewport and glOrtho functions?

suppose that I have an image that I want to apply as a texture on a geometry (at time we don't consider texture mapping but this image has a certain width and height here it is a 512x512 image) I want ...
2
votes
1answer
149 views

How to obtain touch events from a GL Viewport, not the whole screen?

Background I'm implementing viewport resizing in order for my game to maintain the same display ratio on all devices. However, I've found an issue with getting touch events. Basically, if my ...
4
votes
2answers
5k views

Multiple viewpoints in Unity3D?

I'm working on a 3D game in Unity. The primary view is a top-down view, but I am also looking to do target profiles that are true animated versions that reflect the actions of the target. The ...
0
votes
1answer
538 views

Projecting world coordinates to screen coordinates issue - points disappear when origin not in view

I am trying to implement a 2d line drawing effect on a 3d mesh using Ogre. In order to do so, I perform silhouette detection on the lines of the object (this works) and then project these lines from ...
3
votes
2answers
208 views

Formula for converting ratio of current device to target device

I am designing my (Android/OpenGL ES 2.0) app on one device and want it to run all all other devices while keeping the screen ratio of the development device (so the image doesn't stretch / squash), ...
1
vote
1answer
561 views

Centering GLViewport position within physical screen

I'm developing my app on one device and want it to display at the same ratio on all other devices. Currently what I have is 'image 1' in my image below - the game fits perfectly onto my development ...
-1
votes
1answer
405 views

View port for my canvas game

I am developing a canvas game, and im struggling to get my head around how i can make a view port so when the character moves the world moves with it. Unlike traditional 2d maps built with arrays i ...