Skip to content

Commit

Permalink
Add a cursor to complexScene
Browse files Browse the repository at this point in the history
  • Loading branch information
dknaan committed Jul 9, 2016
1 parent 937e673 commit aead309
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -25,7 +25,7 @@
import org.gearvrf.GVRSceneObject;
import org.gearvrf.GVRScript;
import org.gearvrf.debug.GVRConsole;

import org.gearvrf.GVRRenderData;
import java.io.IOException;

public class SampleMain extends GVRScript {
Expand Down Expand Up @@ -56,6 +56,20 @@ public void onInit(GVRContext gvrContext) throws IOException {
scene.getMainCameraRig().getRightCamera()
.setBackgroundColor(Color.WHITE);

float NORMAL_CURSOR_SIZE = 0.4f;
float CURSOR_Z_POSITION = -9.0f;
int CURSOR_RENDER_ORDER = 100000;

GVRSceneObject cursor = new GVRSceneObject(mGVRContext,
mGVRContext.createQuad(NORMAL_CURSOR_SIZE, NORMAL_CURSOR_SIZE),
mGVRContext.loadTexture(new GVRAndroidResource(mGVRContext,
"cursor_idle.png")));
cursor.getTransform().setPositionZ(CURSOR_Z_POSITION);
cursor.getRenderData().setRenderingOrder(
GVRRenderData.GVRRenderingOrder.OVERLAY);
cursor.getRenderData().setDepthTest(false);
cursor.getRenderData().setRenderingOrder(CURSOR_RENDER_ORDER);
mGVRContext.getMainScene().getMainCameraRig().addChildObject(cursor);

try {

Expand Down

0 comments on commit aead309

Please sign in to comment.