Академический Документы
Профессиональный Документы
Культура Документы
Development Guide
V.1.2.3
NanjingDec2016
1
2
Legal Notices
All copyright 2016, Nanjing RuiYue Technology co., LTD. All rights reserved.
The content in this document, copyright belongs to Rui Yue information co., LTD
except specifically stated. This document would be protected from "THE COPYRIGHT
LAW OF THE PEOPLE 'S REPUBLIC OF CHINA" and relevant laws and regulations of all
international treaty. Without our written permission, no unit or individual shall not,
part of this document, otherwise will be regarded as tort. Rui Yue information co.,
LTD. reserves the right to its legal liability shall be pursued in accordance with the law.
Nibiru's all relevant rights belongs to all Rui Yue information technology co., LTD. No
unit or individual shall not, in this document is a reference to decompiled Nibiru SDK
and its related products, modify and redistribute it, otherwise will be regarded as
tort. Rui Yue information technology co., LTD. Reserves the right to its legal liability
This document is not represents the commitment of the supplier or its agents, and
RuiYue information co., LTD., can modify the content of this document without any
declare. Software products involved in this document and its subsequent upgrade
products are produced by Rui Yue information technology co., LTD., and Rui Yue
information co., LTD is responsible for the overall sales. Other companies mentioned
in this document and the product's trademark ownership belongs to the owners.
E-mailsupport@inibiru.com
Webhttp://dev.inibiru.com
Nibiru welcome any Suggestions and comments of users.
3
Document Updates
Version Updates
3. Fix bugs
3. Add GridView
4
Contents
I. Introduction .......................................................................................................................6
5
I. Introduction
code structure and perfect functions and work flow, which has provided
features:
rendering latency;
6
II. Development and Runtime Environments
This framework runs in Nibiru VR system and requires jar package
corresponding Demo project has been uploaded to the forum. After the
For the unclear points, please check the engine demo, consult in the
pictures and pictures in asserts. In the engine, all the textures are
its basic usage can be referred to in the official document. Plist file makes
several textures into a large texture sorted by the original names of the
TexturePackerGUI is as follows:
7
III. UI Control APIs
8
Here are some rendering samples of different controls:
green point.
1. XBaseScene
XBaseScene is the base class for scenes and manages UI element
9
}
public void onGazeTrigger(Context context, String name) {
//Select operations to be
triggered with gaze
}
public boolean onKeyDown(int keyCode) { //Press OK key on the headset
return false;
}
public boolean onKeyUp(int keyCode) { //Release OK
return false;
}
2. XActor
XActor is the base class for UI elements including properties on
rotation angle and center, scaling size, width and height and listener
events, etc.
public abstract class XActor {
private float alpha = 1; //Transparency
private float centerX, centerY, centerZ; //Central point
private float rotationX, rotationY, rotationZ; //Rotation value
private float rotationCenterX, rotationCenterY, rotationCenterZ;
private float scaleX = 1, scaleY = 1, scaleZ = 1; //Scaling value
private float scaleCenterX, scaleCenterY, scaleCenterZ;
private float width, height; //Width and height
private String name;
private IXActorListener actorListener; //Listener events
protected boolean enabled = true; //Enable symbol
10
}
interfaces.
3. XGridView
Nine panels are used to put XImageText on the sphere arc surface
background picture and other four parameters define the starting and
the ending coordinates at both the horizontal and vertical levels of the
curved surface.
0degree
11
4. XSkyBox
XSkyBox class can be used to define sky box and requires to be
Heres a sample:
XSkyBox skybox ;
public void XBaseScene::init()
{
skybox = new XSkyBox("LivingRoom_sence_left.png", 90);
skybox.setRotationY(-90);
addActor(skybox);
}
5. XSkyCubeBox
Ditto, but this sky box accepts 6 image names as the parameters of
Heres a sample:
XSkyCubeBox skycubebox;
public void XBaseScene::init()
{
12
6. XGazePoint
This class is the gaze drawn in the center of the scene. It is inherited
Heres a sample:
public void XBaseScene::init()
{
XGazePoint whitePoint = new XGazePoint();
whitePoint.setCenterPosition(0, 0, -20);
addActor(whitePoint);
}
7. XImage
Image class is to display a picture in the scene and is applicable to
specified image.
Heres a sample:
XImage batteryIconImg;
public void XBaseScene::init()
{
batteryIconImg = new XImage("power_run.png");
batteryIconImg.setCenterPosition(0, 0.95f, -3.90f);
batteryIconImg.setSize(0.3f, 0.15f);
batteryIconImg.setRenderOrder(9);
addActor(batteryIconImg);
}
8. XLabel
It is used in the text display and supports dynamic text replacement
9. XImageText
Combo box is displayed with the image on the top and the text on
the bottom in the scene. When image name is set to null, only text like
When text is set to null, only image like XImage will be displayed and the
Heres a sample:
XGridView iconList;
public void XBaseScene::init()
{
//iconList initialization etc.
XImageText toolImageText = new XImageText();
toolImageText.setImgName("ic_focused.png", "ic_default.png");
toolImageText.setTitle("", "");//Display title name
toolImageText.setTitleColor(Color.WHITE, Color.BLACK);
toolImageText.setName("tool");
14
toolImageText.setSize(0.5f, 0.5f);
toolImageText.setActorListener(itemActorListener);
toolImageText.setSeletedAlign(XAlign.Center);
toolImageText.setSeletedArrangeMode(XArrangementMode.MultiRow);
addGridViewItem(iconList, toolImageText, 30, 0);
toolImageText.updateUnSelectedTitle("Update not selected Title");
toolImageText.updateSelectedTitle("Update selected Title");
toolImageText.updateUnSecletedImage("Update selected Image.png");
toolImageText.updateSelectedImage("Update not selected
Image.png");
}
7.1 Icon
public enum IconAttachStrategy
{
AttachStrategy_UnSelectedBack , //Icon appears after the not selected
image
AttachStrategy_UnSelectedFront, //Icon appears before the not selected
image
AttachStrategy_SelectedBack, //Icon appears after the selected image
AttachStrategy_SelectedFront //Icon appears before the selected image
}
//Call after addActor() and addGridViewItem()
public void addImageIcon(String imagename, IconAttachStrategy iconType,
boolean isActive);
public void addImageIcon(String imagename, IconAttachStrategy iconType,
float sizeRatioX, float posOffsetX,
float posOffsetY, float frontRatio,
boolean isActive);
15
public void setUnSelectIconActive(boolean active);
enumeration values:
public enum XAlign {
Left, //Left alignment
Right, //Right alignment
Center, //Center
Side //Justify
}
16
SingleRowNotMove, //Single row regardless
of length
MultiRow, //Multi-row
SingleRowClip //Intercepted length
}
Example:
toolImageText.setSeletedAlign(XAlign.Center);
toolImageText.setSeletedArrangeMode(XArrangementMode.MultiRow);
label.setSeletedAlign(XAlign.Right);
label.setSeletedArrangeMode(XArrangementMode.MultiRow);
10. XEditText
The input box is used to accept texts entered by users. Constructed
Example:
XEditText editText;
public void XBaseScene::init()
{
editText = new XEditText("Please enter the content");
editText.setCenterPosition(0, -1.0f, -3.85f);
editText.setSize(1.6f, 0.4f);
addActor(editText);
}
11. XInputMethod
17
Input keyboard is used for users to enter characters. This class has a
global object. Show() and dismiss() is to enable and disable the input
keyboard.
Sample:
XInputMethod globalInputMethod;
12. XProcessBar
Process bar control is used to display a rectangle process bar
Example:
public void XBaseScene::init()
{
XProcessBar pbar = new XProcessBar(0.5f, "bg.png", "fg.png");
//Background image, foreground image
addActor(pbar);
pbar.setProcess(0.8f); //Set the display percentage
}
13. XCircleProcessBar
Circle process bar control is used to display a circle process bar
18
parameter during initialization, the background image name and the
Example:
XProgressBar pbar = new XProgressBar(0.0f, "x1.png", "x2.png",
"x2_Btn.png");
pbar.setProgressBarListener(new IXProgressBarListener()
{
@Override
public void onProgress(XProgressBar progressBar, float progress)
{
int p = (int)(progress * 100);
progressBar.setProcess(progress); //Set the display
percentage
}
});
pbar.setSize(2, 0.2f);
pbar.setCenterPosition(0, 0.2f, -4);
addActor(pbar);
14. XVideoPlayer
3 kinds of players: rectangle, sphere, semi-sphere players. APIs are
as follows:
boolean initWithRectInfo(int showType, int texID,XSpaceRect rect)
boolean initWithSubSphereInfo(int showType, int texID,
XVec3 center,float radius,
float beginVertical, float endVertical,
float beginhorizontal, float endhorizontal)
//Start with vertical direction, end with vertical
direction
//Start with horizontal direction, end with
horizontal direction
19
player.initWithRectInfo(....);
}
15. ListView
ListView function is similar to that in Android.
20
This value should also between 0 and 1. Other properties of XActor can be set
by the original function. For example:
XImage bmage;
bmage = new XImage("ic_bluetooth.png");
bmage.setOffsetInListView(0.5f, 0.4f);
bmage.setSizeInListView(0.1f, 0.2f);
mview.pushXActor(bmage);
21
timeLabel.setOffsetInListView(0.1f, 0.1f);
timeLabel.setSizeInListView(0.2f, 0.2f);
timeLabel.setName("time_label");
mview.pushXActor(timeLabel);
}
}
16.XGridViewSimple
XGridViewSimple has packaged common functions.
respectivelyl.
Constructed function:
public XGridViewSimple(float gapAngle, float radius, int showPageNum, float
beginVerAngle, float endVerAngle, float beginhorAngle, float endhorAngle) ;
22
XGridViewSimple.removeXActor(XActor actor), Remove single element
XGridViewSimple.pageUp()Rotate entirely to the left
XGridViewSimple.pageDown()Rotate entirely to the right
XGridViewSimple.updateLayOut()Update the element layout
XGridViewSimple.clearPage(int pageIndex) Clear all the elements in a page
XGridViewSimple.clearPage(XGridViewSimplePage page)Clear all the elements in
a page
XGridViewSimple.setAdapter(IXGridViewAdapter adapter) Set adapter, among which
the prototype of IXGridViewAdapter is as follows:
public interface IXGridViewAdapter
{
public int getCounter();
public XGridViewSimplePage getView(int pos, XListViewItem view);
}
getCounter() returns the number of pages.
getView() sets properties of XGridViewSimplePage object and returns.
XGridViewSimplePage inherits XAcotor and its features are: In constructed
function XGridViewSimplePage(int hnum, int vnum, String bk), these two values
define the number of elements in the horizontal direction and the vertical
direction and bk defines the background color.
XGridViewSimplePage needs to define XActorListener in order to define different
behaviors.
23