예제 #1
0
GUIQuad::GUIQuad(Graphics::GUIElement::GUIElementType type, const Common::UString &texture,
                 float x1 , float y1 , float x2 , float y2,
                 float tX1, float tY1, float tX2, float tY2) :
	GUIElement(type),
	_r(1.0f), _g(1.0f), _b(1.0f), _a(1.0f), _angle(0.0f),
	_x1 (x1) , _y1 (y1) , _x2 (x2) , _y2 (y2) ,
	_tX1(tX1), _tY1(tY1), _tX2(tX2), _tY2(tY2),
	_xscale(1.0f), _yscale(1.0f),
	_scissorX(0), _scissorY(0), _scissorWidth(0), _scissorHeight(0),
	_xor(false), _scissor(false), _blendMode(kBlendDefault),
	_material(0), _shaderRenderable() {

	try {

		if (!texture.empty())
			_texture = TextureMan.get(texture);

	} catch (...) {
		_texture.clear();

		_r = _g = _b = _a = 0.0f;
	}

	if (!_texture.empty() && (_texture.getTexture().getTXI().getFeatures().blending == TXI::kBlendingAdditive)) {
		_blendMode = kBlendAdditive;
	}

	_distance = -FLT_MAX;
	buildMaterial();
}
예제 #2
0
void GUIQuad::setTexture(TextureHandle texture) {
	lockFrameIfVisible();

	_texture = texture;
	buildMaterial();

	unlockFrameIfVisible();
}
GoboComponent::GoboComponent( const std::string& textureName, PyTypePlus * pType ):
	SimpleGUIComponent( textureName, pType ),
	pDiffuseMap_( NULL ),
	pBlurMap_( NULL ),
	pBackBuffer_( NULL )
{	
	material_ = NULL;
	
	buildMaterial();
}
예제 #4
0
 /**
 -----------------------------------------------------------------------------
 TerrainCircleDecorator
 -----------------------------------------------------------------------------
 */
 TerrainCircleDecorator::TerrainCircleDecorator(const String& name, Scene* scene)
     :mScene(scene)
     ,mBoldSize(1)
     ,mColour(ColourValue::Green)
     ,mOgreManualObject(NULL)
     ,mRadius(2)
     ,mBuildPointCount(-1)
 {
     buildMaterial();
     createOgreManualObject();
     buildMesh();
 }
예제 #5
0
GUIQuad::GUIQuad(TextureHandle texture,
                 float x1 , float y1 , float x2 , float y2,
                 float tX1, float tY1, float tX2, float tY2) :
	GUIElement(GUIElement::kGUIElementFront),
	_texture(texture), _r(1.0f), _g(1.0f), _b(1.0f), _a(1.0f), _angle(0.0f),
	_x1 (x1) , _y1 (y1) , _x2 (x2) , _y2 (y2) ,
	_tX1(tX1), _tY1(tY1), _tX2(tX2), _tY2(tY2),
	_xscale(1.0f), _yscale(1.0f),
	_scissorX(0), _scissorY(0), _scissorWidth(0), _scissorHeight(0),
	_xor(false), _scissor(false), _blendMode(kBlendDefault),
	_material(0), _shaderRenderable() {

	_distance = -FLT_MAX;
	buildMaterial();
}
예제 #6
0
void GUIQuad::setTexture(const Common::UString &texture) {
	lockFrameIfVisible();

	try {

		if (texture.empty())
			_texture.clear();
		else
			_texture = TextureMan.get(texture);

	} catch (...) {
		_texture.clear();

		_r = _g = _b = _a = 0.0f;
	}
	buildMaterial();

	unlockFrameIfVisible();
}