当前位置: 首页>>代码示例>>Java>>正文


Java Constants.VERTEX_INDEX_X属性代码示例

本文整理汇总了Java中org.andengine.util.Constants.VERTEX_INDEX_X属性的典型用法代码示例。如果您正苦于以下问题:Java Constants.VERTEX_INDEX_X属性的具体用法?Java Constants.VERTEX_INDEX_X怎么用?Java Constants.VERTEX_INDEX_X使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.andengine.util.Constants的用法示例。


在下文中一共展示了Constants.VERTEX_INDEX_X属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onAreaTouched

@Override
public boolean onAreaTouched(TouchEvent touchEvent, float localTouchX, float localTouchY) {
    final float sceneTouchX = touchEvent.getX();
    final float sceneTouchY = touchEvent.getY();
    for (ITouchArea area: this.touchAreas) {
        if (area.contains(sceneTouchX, sceneTouchY)) {
            final float[] areaTouchCoordinates = area.convertSceneCoordinatesToLocalCoordinates(sceneTouchX, sceneTouchY);
            final float areaTouchX = areaTouchCoordinates[Constants.VERTEX_INDEX_X];
            final float areaTouchY = areaTouchCoordinates[Constants.VERTEX_INDEX_Y];
            final Boolean handled = area.onAreaTouched(touchEvent, areaTouchX, areaTouchY);
            if (handled != null && handled) {
                return true;
            }
        }
    }
    return true;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:17,代码来源:Dialog.java

示例2: fillVertices

public static void fillVertices(final float pLocalX, final float pLocalY, final float pLocalWidth, final float pLocalHeight, final Transformation pLocalToSceneTransformation, final float[] pVertices) {
	final float localXMin = pLocalX;
	final float localXMax = pLocalX + pLocalWidth;
	final float localYMin = pLocalY;
	final float localYMax = pLocalY + pLocalHeight;

	pVertices[0 + Constants.VERTEX_INDEX_X] = localXMin;
	pVertices[0 + Constants.VERTEX_INDEX_Y] = localYMin;

	pVertices[2 + Constants.VERTEX_INDEX_X] = localXMax;
	pVertices[2 + Constants.VERTEX_INDEX_Y] = localYMin;

	pVertices[4 + Constants.VERTEX_INDEX_X] = localXMax;
	pVertices[4 + Constants.VERTEX_INDEX_Y] = localYMax;

	pVertices[6 + Constants.VERTEX_INDEX_X] = localXMin;
	pVertices[6 + Constants.VERTEX_INDEX_Y] = localYMax;

	pLocalToSceneTransformation.transform(pVertices);
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:20,代码来源:RectangularShapeCollisionChecker.java

示例3: onAreaTouched

@Override
public boolean onAreaTouched(final TouchEvent pTouchEvent, final float touchX, final float touchY) {
    boolean handled = this.scrollDetector.onManagedTouchEvent(pTouchEvent);
    //Debug.d("scrollDetector: "+handled);
    if (this.touch_was_scroll || this.is_scrolling) {
        //Debug.d("Touch was scroll ");
        this.touch_was_scroll = false;
        this.scroll_last = System.currentTimeMillis();
        return true;
    } else  {
        //Debug.d("Touch was not scroll ");
        this.touch_was_scroll = false;
        long delay = System.currentTimeMillis() - this.scroll_last;
        if (delay < this.scroll_timeout) {
            return false;
        }
        final float sceneTouchX = pTouchEvent.getX();
        final float sceneTouchY = pTouchEvent.getY();
        for (ITouchArea area: this.touchAreas) {
            if (area.contains(sceneTouchX, sceneTouchY)) {
                final float[] areaTouchCoordinates = area.convertSceneCoordinatesToLocalCoordinates(sceneTouchX, sceneTouchY);
                final float areaTouchX = areaTouchCoordinates[Constants.VERTEX_INDEX_X];
                final float areaTouchY = areaTouchCoordinates[Constants.VERTEX_INDEX_Y];
                final Boolean ishandled = area.onAreaTouched(pTouchEvent, areaTouchX, areaTouchY);
                if (ishandled != null && ishandled) {
                    return true;
                }
            }
        }
        return false;
    }
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:32,代码来源:Scrollable.java

示例4: convertSceneToLocalCoordinates

@Override
public float[] convertSceneToLocalCoordinates(final float pX, final float pY, final float[] pReuse) {
	pReuse[Constants.VERTEX_INDEX_X] = pX;
	pReuse[Constants.VERTEX_INDEX_Y] = pY;

	this.getSceneToLocalTransformation().transform(pReuse);

	return pReuse;
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:9,代码来源:Entity.java

示例5: convertLocalCoordinatesToSceneCoordinates

@Override
public float[] convertLocalCoordinatesToSceneCoordinates(final float[] pCoordinates, final float[] pReuse) {
	final Transformation localToSceneTransformation = this.getLocalToSceneTransformation();

	pReuse[Constants.VERTEX_INDEX_X] = pCoordinates[Constants.VERTEX_INDEX_X];
	pReuse[Constants.VERTEX_INDEX_Y] = pCoordinates[Constants.VERTEX_INDEX_Y];

	localToSceneTransformation.transform(pReuse);

	return pReuse;
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:11,代码来源:Entity.java

示例6: convertLocalCoordinatesToParentCoordinates

@Override
public float[] convertLocalCoordinatesToParentCoordinates(final float[] pCoordinates, final float[] pReuse) {
	final Transformation localToParentTransformation = this.getLocalToParentTransformation();

	pReuse[Constants.VERTEX_INDEX_X] = pCoordinates[Constants.VERTEX_INDEX_X];
	pReuse[Constants.VERTEX_INDEX_Y] = pCoordinates[Constants.VERTEX_INDEX_Y];

	localToParentTransformation.transform(pReuse);

	return pReuse;
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:11,代码来源:Entity.java

示例7: convertParentCoordinatesToLocalCoordinates

@Override
public float[] convertParentCoordinatesToLocalCoordinates(final float pX, final float pY, final float[] pReuse) {
	pReuse[Constants.VERTEX_INDEX_X] = pX;
	pReuse[Constants.VERTEX_INDEX_Y] = pY;

	this.getParentToLocalTransformation().transform(pReuse);

	return pReuse;
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:9,代码来源:Entity.java

示例8: spawnParticle

private void spawnParticle() {
	if (this.mParticlesAlive < this.mParticlesMaximum) {
		Particle<T> particle = this.mParticles[this.mParticlesAlive];

		/* New particle needs to be created. */
		this.mParticleEmitter.getPositionOffset(ParticleSystem.POSITION_OFFSET_CONTAINER);

		final float x = ParticleSystem.POSITION_OFFSET_CONTAINER[Constants.VERTEX_INDEX_X];
		final float y = ParticleSystem.POSITION_OFFSET_CONTAINER[Constants.VERTEX_INDEX_Y];

		if (particle == null) {
			particle = new Particle<T>();
			this.mParticles[this.mParticlesAlive] = particle;
			particle.setEntity(this.mEntityFactory.create(x, y));
		} else {
			particle.reset();
			particle.getEntity().setPosition(x, y);
		}

		/* Apply particle initializers. */
		{
			for (int i = this.mParticleInitializers.size() - 1; i >= 0; i--) {
				this.mParticleInitializers.get(i).onInitializeParticle(particle);
			}

			for (int i = this.mParticleModifiers.size() - 1; i >= 0; i--) {
				this.mParticleModifiers.get(i).onInitializeParticle(particle);
			}
		}

		this.mParticlesAlive++;
	}
}
 
开发者ID:mediamonks,项目名称:tilt-game-android,代码行数:33,代码来源:ParticleSystem.java

示例9: convertAxisAlignedSurfaceCoordinatesToSceneCoordinates

private void convertAxisAlignedSurfaceCoordinatesToSceneCoordinates(final float[] pSurfaceCoordinates, final float pRelativeX, final float pRelativeY) {
	final float xMin = this.getXMin();
	final float xMax = this.getXMax();
	final float yMin = this.getYMin();
	final float yMax = this.getYMax();

	final float x = xMin + pRelativeX * (xMax - xMin);
	final float y = yMin + pRelativeY * (yMax - yMin);

	pSurfaceCoordinates[Constants.VERTEX_INDEX_X] = x;
	pSurfaceCoordinates[Constants.VERTEX_INDEX_Y] = y;
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:12,代码来源:Camera.java

示例10: unapplyCameraSceneRotation

private void unapplyCameraSceneRotation(final TouchEvent pCameraSceneTouchEvent) {
	final float cameraSceneRotation = this.mCameraSceneRotation;

	if (cameraSceneRotation != 0) {
		Camera.VERTICES_TMP[Constants.VERTEX_INDEX_X] = pCameraSceneTouchEvent.getX();
		Camera.VERTICES_TMP[Constants.VERTEX_INDEX_Y] = pCameraSceneTouchEvent.getY();

		MathUtils.revertRotateAroundCenter(Camera.VERTICES_TMP, cameraSceneRotation, this.getCameraSceneWidth() * 0.5f, this.getCameraSceneHeight() * 0.5f); // TODO Use a Transformation object instead!?!

		pCameraSceneTouchEvent.set(Camera.VERTICES_TMP[Constants.VERTEX_INDEX_X], Camera.VERTICES_TMP[Constants.VERTEX_INDEX_Y]);
	}
}
 
开发者ID:mediamonks,项目名称:tilt-game-android,代码行数:12,代码来源:Camera.java

示例11: convertAxisAlignedSceneCoordinatesToSurfaceCoordinates

private void convertAxisAlignedSceneCoordinatesToSurfaceCoordinates(final float[] pSceneCoordinates, final int pSurfaceWidth, final int pSurfaceHeight) {
	final float xMin = this.getXMin();
	final float xMax = this.getXMax();
	final float yMin = this.getYMin();
	final float yMax = this.getYMax();

	final float relativeX = (pSceneCoordinates[Constants.VERTEX_INDEX_X] - xMin) / (xMax - xMin);
	final float relativeY = 1 - (pSceneCoordinates[Constants.VERTEX_INDEX_Y] - yMin) / (yMax - yMin);

	pSceneCoordinates[Constants.VERTEX_INDEX_X] = relativeX * pSurfaceWidth;
	pSceneCoordinates[Constants.VERTEX_INDEX_Y] = relativeY * pSurfaceHeight;
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:12,代码来源:Camera.java

示例12: spawnParticle

private void spawnParticle() {
	if(this.mParticlesAlive < this.mParticlesMaximum){
		Particle<T> particle = this.mParticles[this.mParticlesAlive];

		/* New particle needs to be created. */
		this.mParticleEmitter.getPositionOffset(ParticleSystem.POSITION_OFFSET_CONTAINER);

		final float x = ParticleSystem.POSITION_OFFSET_CONTAINER[Constants.VERTEX_INDEX_X];
		final float y = ParticleSystem.POSITION_OFFSET_CONTAINER[Constants.VERTEX_INDEX_Y];

		if(particle == null) {
			particle = new Particle<T>();
			this.mParticles[this.mParticlesAlive] = particle;
			particle.setEntity(this.mEntityFactory.create(x, y));
		} else {
			particle.reset();
			particle.getEntity().setPosition(x, y);
		}

		/* Apply particle initializers. */
		{
			for(int i = this.mParticleInitializers.size() - 1; i >= 0; i--) {
				this.mParticleInitializers.get(i).onInitializeParticle(particle);
			}

			for(int i = this.mParticleModifiers.size() - 1; i >= 0; i--) {
				this.mParticleModifiers.get(i).onInitializeParticle(particle);
			}
		}

		this.mParticlesAlive++;
	}
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:33,代码来源:ParticleSystem.java

示例13: onAreaTouchEvent

private Boolean onAreaTouchEvent(final TouchEvent pSceneTouchEvent, final float sceneTouchEventX, final float sceneTouchEventY, final ITouchArea touchArea) {
	final float[] touchAreaLocalCoordinates = touchArea.convertSceneCoordinatesToLocalCoordinates(sceneTouchEventX, sceneTouchEventY);
	final float touchAreaLocalX = touchAreaLocalCoordinates[Constants.VERTEX_INDEX_X];
	final float touchAreaLocalY = touchAreaLocalCoordinates[Constants.VERTEX_INDEX_Y];

	final boolean handledSelf = touchArea.onAreaTouched(pSceneTouchEvent, touchAreaLocalX, touchAreaLocalY);
	if (handledSelf) {
		return Boolean.TRUE;
	} else if (this.mOnAreaTouchListener != null) {
		return this.mOnAreaTouchListener.onAreaTouched(pSceneTouchEvent, touchArea, touchAreaLocalX, touchAreaLocalY);
	} else {
		return null;
	}
}
 
开发者ID:mediamonks,项目名称:tilt-game-android,代码行数:14,代码来源:Scene.java

示例14: applySceneRotation

private void applySceneRotation(final TouchEvent pCameraSceneTouchEvent) {
	final float rotation = this.mRotation;

	if (rotation != 0) {
		Camera.VERTICES_TMP[Constants.VERTEX_INDEX_X] = pCameraSceneTouchEvent.getX();
		Camera.VERTICES_TMP[Constants.VERTEX_INDEX_Y] = pCameraSceneTouchEvent.getY();

		MathUtils.rotateAroundCenter(Camera.VERTICES_TMP, rotation, this.getCenterX(), this.getCenterY()); // TODO Use a Transformation object instead!?!

		pCameraSceneTouchEvent.set(Camera.VERTICES_TMP[Constants.VERTEX_INDEX_X], Camera.VERTICES_TMP[Constants.VERTEX_INDEX_Y]);
	}
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:12,代码来源:Camera.java

示例15: unapplySceneRotation

private void unapplySceneRotation(final TouchEvent pSceneTouchEvent) {
	final float rotation = this.mRotation;

	if (rotation != 0) {
		Camera.VERTICES_TMP[Constants.VERTEX_INDEX_X] = pSceneTouchEvent.getX();
		Camera.VERTICES_TMP[Constants.VERTEX_INDEX_Y] = pSceneTouchEvent.getY();

		MathUtils.revertRotateAroundCenter(Camera.VERTICES_TMP, rotation, this.getCenterX(), this.getCenterY()); // TODO Use a Transformation object instead!?!

		pSceneTouchEvent.set(Camera.VERTICES_TMP[Constants.VERTEX_INDEX_X], Camera.VERTICES_TMP[Constants.VERTEX_INDEX_Y]);
	}
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:12,代码来源:Camera.java


注:本文中的org.andengine.util.Constants.VERTEX_INDEX_X属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。