您的位置:首页 > 移动开发 > Android开发

Google cardBoard Android API (十四):ViewPort

2016-03-21 15:27 429 查看


Viewport

public class Viewport

Defines a viewport rectangle.


Fields

public int height
public int width

public intx
public inty


Public Constructors

Viewport()


Public Methods

booleanequals(Object obj)
void, int)]getAsArray(int[]
array, int offset)
inthashCode()
voidsetGLScissor()
voidsetGLViewport()
voidsetViewport(int
x, int y, int width, int height)
StringtoString()


Inherited Methods

▸From class java.lang.Object


Fields


public int height


public int width


public int x


public int y


Public Constructors


public Viewport ()


Public Methods


public boolean equals (Object obj)


public void getAsArray (int[] array, int offset)

Stores the viewport parameters into an int array.


Parameters


arrayArray to store values in.
offsetOffset into the array to start writing values in.

Throws


IllegalArgumentExceptionIf there is not enough space to write the result.


public int hashCode ()


public void setGLScissor ()

Sets the current OpenGL scissor rect based on the current viewport settings.


public void setGLViewport ()

Sets the current OpenGL viewport based on the current viewport settings.


public void setViewport (int x, int y, int width, int height)

Sets a new viewport based on the provided coordinates and dimensions.


Parameters


xHorizontal pixel coordinate of the bottom-left corner of the viewport.
yVertical pixel coordinate of the bottom-left corner of the viewport.
widthWidth of the viewport in pixels.
heightHeight of the viewport in pixels.


public String toString ()

Returns a string containing a concise, human-readable description of this object.


Returns


A printable representation of this object.

width
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: