We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [viewport]

An area (typically rectangular) expressed in rendering-device-specific coordinates, e.g. pixels for screen coordinates, in which the objects of interest are going to be rendered

Filter by
Sorted by
Tagged with
0
votes
0answers
38 views

LibGDX Android Choosing Viewport Stretching Problem and Aspect Ratio

I am trying to find a viewport for my android game so that it will look okay across different devices and i wont use pixels anymore(i use artificial world coords). I read the viki and watched some ...
0
votes
0answers
14 views

How to draw a rectangle with a border pixel over a camera/viewport?

With this code I intended to visually delimit the complete view of the circuit and the two controlled cars: ...
0
votes
0answers
36 views

Confused on graphics rendering

Implementing a viewport is just a rectangular space on the back buffer usually a 2d texture set to the size of the client window that we render to. However in direct3d when we describe the viewport ...
0
votes
1answer
12 views

Problem displaying drawing of a path in camera/viewport

I have an adm object, which draws the path in the room like this (Object ADM - Draw Event): ...
0
votes
0answers
4 views

Maya Joints Don't Display Correctly in Viewport

I'm using Maya 2018 When I rotate a joint in Maya it doesn't appear to rotate in the viewport but when I check the channel box I can see that it's rotating. The same thing happens with scale. When I ...
0
votes
0answers
43 views

LibGDX: Issues with two viewports, one from stage

I am frustrated.^^ I want to build a game that can run on different screen sizes using LibGDX. The best strategy for me seems to be to use a FitViewport so that I ...
0
votes
0answers
37 views

Keep player within screen bounds, top down shooter

I am using x and z axis to go left/right ; up/down respectively. The Camera is on the y-axis. I have the following code so far - private float playerWidth; private float playerDepth; ...
0
votes
0answers
29 views

Why is there 2 viewport in D3D12Fullscreen sample? What is sceneviewport for?

In Microsoft's DX12 sample, there are 2 viewports (with 2 scissors, and 2 heap descriptors). It seems that only the postviewport is used (at each resize, ...
0
votes
0answers
16 views

Character sprite breaks after adding viewport

I am developing a game within gamemaker studio 2, a small RPG style game and I want it so that the camera follows the character as with a lot of similar games. When I run the game from the .exe file,...
2
votes
1answer
87 views

How do I render a cylindrical world space onto a flat, 2D view port in Unity?

The question is just a logical extension of this question. So, how should I render a cylindrical world space onto a flat, 2D view port in Unity? Thank you.
0
votes
1answer
154 views

Unity | Camera - Follow target with view port point's offset from center

Some additional remarks before I address the issue: How Viewports work in Unity: Whatever the dimensions of the screen's rect, the viewports coordinates are mapped in normalized coordinates, where 0 ...
0
votes
1answer
33 views

World position reconstruction from depth fails when viewport size does not match window size

I'm facing very strange issue. My code for world pos reconstruction works correctly when the viewport size is equal to window size (or framebuffer size in other words). Below is the part for ...
0
votes
1answer
119 views

Transforming 2D viewport coordinates after scaling the viewport (zoom in/out)

I've been getting started with personal experimentation and have been working on a project for a few days now using SDL2. It is a 2D game, and at this stage I have it rendering game objects in a fixed-...
2
votes
0answers
414 views

Why doesn't the Camera.pixel(Height/Width) match the Canvas size?

I am making an app that has a custom viewport Rect like so: When I check the sizes of this viewport rectangle in pixels with Camera.pixelHeight; Camera.pixelWidth,...
2
votes
2answers
81 views

Custom Camera View Fustrum in Unity

Is it possible in Unity to make some sort of bounding box (with a running application) within the current viewpoint of the actual screen? Let me explain: I'm working on a project which uses a ...
0
votes
1answer
22 views

Setting up a low res viewport to stretch in Unity

I am working on porting a low-res game over to Unity. In my previous engine, I had the option to set a native resolution (say, 160 x 144), and it would automatically stretch when the player entered ...
1
vote
0answers
110 views

Performance problems with scrolling html5 canvas for large tile-based game

I try programming a splix.io clone as an electron app and do the visualization via the html5 canvas. The movement across the tiles should look fluent like the original, so I target 60 frames a second. ...
1
vote
1answer
223 views

Javascript/HTML5 canvas: Integrate scrolling tilemap with map server

I am playing around adapting the example code at Mozilla Dev Network: Square tilemaps implementation: Scrolling maps to fit with a server I wrote myself. There's a link to the original source code at ...
0
votes
2answers
55 views

How to keep an object in a certain part of the camera view?

I have a 3d camera that is viewing a character that is moving. As the character is moving i want the camera to adjust itself so as to keep the character in the left third of the camera view. I ...
-4
votes
1answer
188 views

Making Minecraft in 2D. Blocks move when player moves

I want to make a 2D Minecraft game and I have drawn the grass blocks and you can dig but when the palyer moves the dirt moves too. It draws on every block wich the player touches a dirt block because ...
0
votes
1answer
216 views

How to load/unload chunks data where view port is currently focused on?

I have a 2D tile based engine with infinite procedural chunk generation. But I can't invent an algorithm, that will fill only chunk tiles on view port (and destroy old). Pls help ViewPort size can ...
1
vote
2answers
157 views

libgdx Camera and World Size Question

I'm new to libgdx and especially to using OrthographicCameras. I'm trying to understand how useful they are. The question is, suppose I have a game map 500 units wide. I have an OrtographicCamera ...
1
vote
1answer
307 views

3D camera - window resolution relation

I'm having a bit of an issue when it comes to 3D- and 2D camera(s), in relation to a game's window resolution. I want to let the player choose from different window resolutions, either from a menu or ...
0
votes
1answer
121 views

How do I deal with this tilemap wraparound edge case?

I'm building a 2D game engine that uses tilesets to build levels. I recently added functionality to handle wraparounds (ie. where the right edge of the map connects to the left edge.) The engine ...
0
votes
2answers
195 views

LibGDX - GameWorld Dimensions vs ViewPort Dimensions vs Camera Dimensions

Before someone mark it duplicate - I am aware that there are few questions already on this topic but the explanations are all theoretical and no graphical elaboration was provided which I think will ...
1
vote
0answers
347 views

get position of GameObject on rendertexture from camera

I'm rendering the camera output to an rendertexture on a plane. This works fine. But I want to put GameObjects on the rendertexture on positions of world objects that are visible on the camera. <...
1
vote
0answers
52 views

Implementing navigatable achievement menu in javascript

I am in the process of learning javascript for game design, and wanted to make a separate achievement page that the user can navigate to that will allow them to check their achievements on various ...
0
votes
1answer
2k views

How to restrict the players movement win relation to screen bounds in Unity? (Without colliders)

I am really enjoying making the switch to Unity. But here I have found one of those rare moments where it appears to make things more difficult (at least it is for me as I am crap at understanding the ...
2
votes
1answer
587 views

LibGDX - Camera and viewport initialization in show()?

I'm reading the book LibGDX game development by example and the author tends to follow a pattern like ...
-1
votes
1answer
104 views

How to smooth viewport panning when using minimap (in typical RTS)?

Let's take typical modern RTS game which features a large map (say 256x256 tiles). There's also a minimap in the GUI, typically up to 256x256 pixels in size. (Let's take these numbers for upcoming ...
2
votes
4answers
2k views

How and when do the model to world, world to view, et cetera multiplications happen?

I learn matrix transformations for game design and I struggle with some basic concepts. I see the actual multiplication taking place before rendering in this sequence: MODEL into WORLD: multiply each ...
2
votes
2answers
696 views

How can I add solid collideable borders to the viewport regardless of the resolution?

I'm making a game in Unity. In my game I have a sphere, what I need is for the sphere to rebound against the edges of the viewport. For that I used a few Gameobjects with 2D box colliders. The ...
1
vote
1answer
982 views

Using Multiple Viewports in LibGDX?? help needed badly

I've asked this question before but i am still unclear of how to do this after hours of frustration I have messed up yet another decent project I've been working on. I had a fully functioning Snake ...
2
votes
1answer
604 views

Gdx.graphics.getWidth() vs cam.viewport width

I'm facing difficulty understanding the difference between Gdx.graphics.getWidth() vs cam.viewportwidth, What is the difference?
1
vote
0answers
221 views

Libgdx handle screen resolutions

I know there are some questions to this topic, but i didnt find a satisfying answer for my problem yet. I'm learning to use libgdx right now, and I'm not sure about handling different screen ...
1
vote
2answers
4k views

Drawing only objects that are currently in viewport [Gamemaker]

Following on from my previous question about optimising large object counts in Gamemaker, I am looking for a method for the solution proposed by liggiorgio. My game has large numbers of small, sprite-...
0
votes
1answer
906 views

How to calculate 2D viewport coordinates in a shader?

In Unity, I use the following shader to calculate 2D viewport coordinates : ...
1
vote
1answer
316 views

glViewport and single-pass cubemap rendering

This question is related to another question of mine on StackOverflow. The problem I'm facing is that while I'm rendering to a cubemap in a single pass using a geometry shader (like I show in my ...
3
votes
2answers
4k views

How to use the SDL viewport properly?

I'm very confused about the SDL2 viewport, I did some googling to find out how to implement it but people keep mentioning things like "world coordinates" which I don't have in my game. Question : Do ...
1
vote
1answer
2k views

ScreenSize vs. WorldSize

While programming a game with LibGDX, I came across a problem. My OrthographicCamera wasn't centering in the right place. I was trying to center the camera by using the line of code: ...
0
votes
1answer
1k views

How to split a screen in half using LibGDX without scaling?

I am currently working on a racing game with libGDX and I need to split the screen in half for a two-players mode. (Player 1 in first half and Player 2 in second half). I already have Camera1 that ...
1
vote
3answers
240 views

LibGDX - Trying to make a radar-like display

i have an interesting question about geometry. I have two or more moving objects outside of my stage's viewport (blue and red circle in the image below), which i want to point at with two arrows on ...
0
votes
1answer
406 views

I can't center my actors with ExtendViewport, Libgdx

I'm making a level select screen and I need use ExtendViewPort (I can't use Fit for other reasons), but this viewport moves my actors to the left, I need center them. I put X and Y position ...
0
votes
1answer
468 views

How to refresh Unreal Editor Viewport when dragging a spinbox (FModeToolkit)?

The viewport of my custom EdMode does not update while I drag a spinbox (which is in a custom FModeToolkit). In fact, MyCustomEdMode::Render() is not even called (while the spinbox). How can I ...
0
votes
1answer
315 views

GlViewport-code doesn't work in one specific screen?

I am currently working on a small game using LibGDX and Java. However, I have found one oddly specific problem. I want the game to resize so that it never has to be cropped and so it never has to cut ...
1
vote
1answer
242 views

Vertically mirroring the screen in LibGDX

I'm developing a game in which the screen layout is different for right and lefty players, so i'll put a button in it to mirror the screen vertically. For displaying textures and fonts, i use a ...
1
vote
1answer
281 views

2D sunrise in Unity

I see a lot of guides on how to create sunrise in 3D space, but I can't find much information on how to do it in 2D. In 3D, you rotate a lightsource around itself, but in 2D, I need to move the object ...
2
votes
1answer
347 views

Scalling down libgdx game to fit a smaller screen appears only the half of the stage?

Hello I have made a game in 1280x720, but I want it to fit devices with smaller size, so far no luck with the current code it only shows the left half of the screen, it also does not work with bigger ...
3
votes
1answer
1k views

LibGDX Overlay Game with Stage

I have been working on a 2d game that is similar to billiards/pool. I've got the basic game down and now I'm working on some visual effects. One of the things I would like to do is have have numbers ...
1
vote
1answer
235 views

Scene2D viewport affects all other cameras despite having a separate one

I have two cameras initialized as such: ...