Example #1
0
void CoverArt::reshape() {

	VisualCamera aCamera;
	aCamera.setPerspectiveProjection(3.0);
	this->coverArtAsset.setCamera(aCamera);

	VisualStagePosition coverArtAssetPosition = this->coverArtAsset.getPosition();

	coverArtAssetPosition.reset();
	
	VisualStageBox* coverArtAssetBox = this->coverArtAsset.getBox();
	
	double coordDepth = this->calcCoordDepth();
		
	coverArtAssetPosition.depthAlignment = kDepthCenterAligned;
	coverArtAssetBox->setCoordDepth(coordDepth);

	coverArtAssetPosition.horizontalAlignment = kCenterAligned;
	coverArtAssetPosition.verticalAlignment = kMiddleAligned;

	coverArtAssetPosition.minMarginBottom = (double)VisualDataStore::getValueInt(VisualDataStore::kTrackInfoTextureHeight) + 5.0;
	coverArtAssetPosition.minMarginBottomUnit = kPixel;

	coverArtAssetPosition.minMarginTop = 5;
	coverArtAssetPosition.minMarginTopUnit = kPixel;

	coverArtAssetPosition.minMarginLeft = 5;
	coverArtAssetPosition.minMarginLeftUnit = kPixel;

	coverArtAssetPosition.minMarginRight = 5;
	coverArtAssetPosition.minMarginRightUnit = kPixel;
	
	this->coverArtAsset.setPosition(coverArtAssetPosition);
	
	coverArtAssetBox->update(); // VisualStageBox only updates automatically on value changed, after canvas reshape event we have to update manually (before calculating scaleFactor) 
	coverArtAssetBox->setScalingBehaviour(kPreserveAspectRatio);
	
	VisualVertex* aVertex = NULL;

	coverArtAssetBox->initializeVertexChain(this->vertexChainId);
	
	aVertex = coverArtAssetBox->createVertex(0.0, 1.0, 0.5, 0.0, 1.0);
	coverArtAssetBox->addVertexToChain(this->vertexChainId, aVertex);
	
	aVertex = coverArtAssetBox->createVertex(0.0, 0.0, 0.5, 0.0, 0.0);
	coverArtAssetBox->addVertexToChain(this->vertexChainId, aVertex);
	
	aVertex = coverArtAssetBox->createVertex(1.0, 0.0, 0.5, 1.0, 0.0);
	coverArtAssetBox->addVertexToChain(this->vertexChainId, aVertex);

	aVertex = coverArtAssetBox->createVertex(1.0, 1.0, 0.5, 1.0, 1.0);
	coverArtAssetBox->addVertexToChain(this->vertexChainId, aVertex);

}
Example #2
0
void Beatlight::reshape() {

	VisualCamera aCamera;
	aCamera.setOrthographicProjection();
	this->beatlightAsset.setCamera(aCamera);

	VisualStagePosition beatlightAssetPosition = this->beatlightAsset.getPosition();

	beatlightAssetPosition.reset();
	
	VisualStageBox* beatlightAssetBox = this->beatlightAsset.getBox();
	
	//double coordDepth = this->calcCoordDepth();
		
	//coverArtAssetPosition.depthAlignment = kDepthCenterAligned;
	//coverArtAssetBox->setCoordDepth(coordDepth);

	beatlightAssetPosition.horizontalAlignment = kLeftAligned;
	beatlightAssetPosition.verticalAlignment = kBottomAligned;
	beatlightAssetPosition.verticalCoordOffset = VisualActorGraphics::yPixelToCoord(220, aCamera);
	
	this->beatlightAsset.setPosition(beatlightAssetPosition);
	
	beatlightAssetBox->update(); // VisualStageBox only updates automatically on value changed, after canvas reshape event we have to update manually (before calculating scaleFactor) 
	beatlightAssetBox->setScalingBehaviour(kPreserveAspectRatio);
	
	VisualVertex* aVertex = NULL;

	beatlightAssetBox->initializeVertexChain(this->vertexChainId);
	
	aVertex = beatlightAssetBox->createVertex(0.0, 1.0, 0.5, 0.0, 1.0);
	beatlightAssetBox->addVertexToChain(this->vertexChainId, aVertex);
	
	aVertex = beatlightAssetBox->createVertex(0.0, 0.0, 0.5, 0.0, 0.0);
	beatlightAssetBox->addVertexToChain(this->vertexChainId, aVertex);
	
	aVertex = beatlightAssetBox->createVertex(1.0, 0.0, 0.5, 1.0, 0.0);
	beatlightAssetBox->addVertexToChain(this->vertexChainId, aVertex);

	aVertex = beatlightAssetBox->createVertex(1.0, 1.0, 0.5, 1.0, 1.0);
	beatlightAssetBox->addVertexToChain(this->vertexChainId, aVertex);

}
Example #3
0
void TrackTitle::reshape() {

	VisualCamera aCamera;
	aCamera.setOrthographicProjection();
	this->trackInfoAsset.setCamera(aCamera);

	VisualStageBox* trackInfoAssetBox = this->trackInfoAsset.getBox();
	trackInfoAssetBox->setScalingBehaviour(kPreserveAspectRatio);

	VisualStagePosition trackInfoAssetPosition = this->trackInfoAsset.getPosition();
	
	trackInfoAssetPosition.reset();
	
	trackInfoAssetPosition.horizontalAlignment = kCenterAligned;
	trackInfoAssetPosition.verticalAlignment = kBottomAligned;
	
	this->trackInfoAsset.setPosition(trackInfoAssetPosition);

	VisualVertex* aVertex = NULL;
	trackInfoAssetBox->initializeVertexChain(this->vertexChainId);

	VertexColor aVertexColor;
	for (uint8 i = 0; i < 4; i++) {
		switch (i) {
			case 0:
				aVertexColor.r = VisualPreferences::getValue(VisualPreferences::kTrackInfoTextureColorTopLeftRed);
				aVertexColor.g = VisualPreferences::getValue(VisualPreferences::kTrackInfoTextureColorTopLeftGreen);
				aVertexColor.b = VisualPreferences::getValue(VisualPreferences::kTrackInfoTextureColorTopLeftBlue);
				aVertexColor.a = VisualPreferences::getValue(VisualPreferences::kTrackInfoTextureColorTopLeftAlpha);
				aVertexColor.red = aVertexColor.r;
				aVertexColor.green = aVertexColor.g;
				aVertexColor.blue = aVertexColor.b;
				aVertexColor.alpha = aVertexColor.a;
				aVertex = trackInfoAssetBox->createVertex(0.0, 1.0, 0.0, 0.0, 1.0, aVertexColor);
				trackInfoAssetBox->addVertexToChain(this->vertexChainId, aVertex);
				break;
			case 1:
				aVertexColor.r = VisualPreferences::getValue(VisualPreferences::kTrackInfoTextureColorBottomLeftRed);
				aVertexColor.g = VisualPreferences::getValue(VisualPreferences::kTrackInfoTextureColorBottomLeftGreen);
				aVertexColor.b = VisualPreferences::getValue(VisualPreferences::kTrackInfoTextureColorBottomLeftBlue);
				aVertexColor.a = VisualPreferences::getValue(VisualPreferences::kTrackInfoTextureColorBottomLeftAlpha);
				aVertexColor.red = aVertexColor.r;
				aVertexColor.green = aVertexColor.g;
				aVertexColor.blue = aVertexColor.b;
				aVertexColor.alpha = aVertexColor.a;
				aVertex = trackInfoAssetBox->createVertex(0.0, 0.0, 0.0, 0.0, 0.0, aVertexColor);
				trackInfoAssetBox->addVertexToChain(this->vertexChainId, aVertex);
				break;
			case 2:
				aVertexColor.r = VisualPreferences::getValue(VisualPreferences::kTrackInfoTextureColorBottomRightRed);
				aVertexColor.g = VisualPreferences::getValue(VisualPreferences::kTrackInfoTextureColorBottomRightGreen);
				aVertexColor.b = VisualPreferences::getValue(VisualPreferences::kTrackInfoTextureColorBottomRightBlue);
				aVertexColor.a = VisualPreferences::getValue(VisualPreferences::kTrackInfoTextureColorBottomRightAlpha);
				aVertexColor.red = aVertexColor.r;
				aVertexColor.green = aVertexColor.g;
				aVertexColor.blue = aVertexColor.b;
				aVertexColor.alpha = aVertexColor.a;
				aVertex = trackInfoAssetBox->createVertex(1.0, 0.0, 0.0, 1.0, 0.0, aVertexColor);
				trackInfoAssetBox->addVertexToChain(this->vertexChainId, aVertex);
				break;
			case 3:
				aVertexColor.r = VisualPreferences::getValue(VisualPreferences::kTrackInfoTextureColorTopRightRed);
				aVertexColor.g = VisualPreferences::getValue(VisualPreferences::kTrackInfoTextureColorTopRightGreen);
				aVertexColor.b = VisualPreferences::getValue(VisualPreferences::kTrackInfoTextureColorTopRightBlue);
				aVertexColor.a = VisualPreferences::getValue(VisualPreferences::kTrackInfoTextureColorTopRightAlpha);
				aVertexColor.red = aVertexColor.r;
				aVertexColor.green = aVertexColor.g;
				aVertexColor.blue = aVertexColor.b;
				aVertexColor.alpha = aVertexColor.a;
				aVertex = trackInfoAssetBox->createVertex(1.0, 1.0, 0.0, 1.0, 1.0, aVertexColor);
				trackInfoAssetBox->addVertexToChain(this->vertexChainId, aVertex);
				break;
			default:
				writeLog("ERR: switch case unknown");
		}
	}

	char trackLayoutPos[128];
	sprintf(trackLayoutPos, "top: %f, left: %f, bottom: %f, right: %f", trackInfoAssetBox->getTopCoord(), trackInfoAssetBox->getLeftCoord(), trackInfoAssetBox->getBottomCoord(), trackInfoAssetBox->getRightCoord());
	setProcessInfo("TrackLayout", trackLayoutPos);

}