Google cardBoard Android API (十三):ScreenParams

20 篇文章 0 订阅
18 篇文章 0 订阅

ScreenParams

public class ScreenParams

Defines the physical parameters of a screen to be used with a Cardboard-compatible device.

Public Constructors

ScreenParams(Display display)

Public Methods

staticScreenParams
createFromInputStream(Display display, InputStream inputStream)
boolean
equals(Object other)
float
int
float
int
float
void
setBorderSizeMeters(float screenBorderSize)
void
setHeight(int height)
void
setWidth(int width)
String

Inherited Methods

Public Constructors

public ScreenParams (Display display)

Initializes parameters to default values.

Public Methods

public static ScreenParams createFromInputStream (Display display, InputStreaminputStream)

Initializes the screen parameters from an InputStream.

Caller is responsible for closing stream.

Parameters
inputStream input stream containing phone params.
Returns
  • A new ScreenParams object or null in case of error.
public boolean equals (Object other)

Compares this instance with the specified object and indicates if they are equal.

Parameters
other The object to compare this instance with.
Returns
  • true if the objects are equal, false otherwise.
public float getBorderSizeMeters ()

Returns the screen border size.

Returns
  • The screen border size in meters.
public int getHeight ()

Returns the screen height in pixels.

Returns
  • The screen height in pixels.
public float getHeightMeters ()

Returns the screen height in meters.

Returns
  • The screen height in meters.
public int getWidth ()

Returns the screen width in pixels.

Returns
  • The screen width in pixels.
public float getWidthMeters ()

Returns the screen width in meters.

Returns
  • The screen width in meters.
public void setBorderSizeMeters (float screenBorderSize)

Size of the border around the device screen.

Offset in meters from the bottom side of the inserted device to the bottom of the screen. Normally a small border of a few millimeters height when the device is in landscape position.

Parameters
screenBorderSize The screen border size in meters.
public void setHeight (int height)

Sets the screen height in pixels.

Parameters
height The screen width in pixels.
public void setWidth (int width)

Sets the screen width in pixels.

Parameters
width The screen size in pixels.
public String toString ()

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

Returns
  • A printable representation of this object.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值