Exemplo n.º 1
0
void CoverArt::calcPositionOnScreen()
{

    VisualActorGraphics::prepareCoverArtAction();

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

    coverArtAssetPosition.reset();

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

    coverArtAssetPosition.minMarginBottom = (double)VisualDataStore::getValueInt(VisualConfiguration::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);

    VisualStageBox* coverArtAssetBox = this->coverArtAsset.getBox();
    coverArtAssetBox->update(); // VisualStageBox only updates automatically on value changed, after canvas reshape event we have to update manually (before calculating scaleFactor)
    coverArtAssetBox->setScalingBehaviour(kPreserveAspectRatio);

    this->coverArtAsset.generateVertexChain(kFrontVertexChain);

    VisualActorGraphics::finishCoverArtAction();

}
Exemplo n.º 2
0
void Beatlight::calcPositionOnScreen() {

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

	beatlightAssetPosition.reset();
	
	beatlightAssetPosition.horizontalAlignment = kRightAligned;
	beatlightAssetPosition.verticalAlignment = kTopAligned;

	beatlightAssetPosition.minMarginBottom = 5;
	beatlightAssetPosition.minMarginBottomUnit = kPixel;

	beatlightAssetPosition.minMarginTop = 20;
	beatlightAssetPosition.minMarginTopUnit = kPixel;

	beatlightAssetPosition.minMarginLeft = 5;
	beatlightAssetPosition.minMarginLeftUnit = kPixel;

	beatlightAssetPosition.minMarginRight = 20;
	beatlightAssetPosition.minMarginRightUnit = kPixel;
	
	this->beatlightAsset.setPosition(beatlightAssetPosition);
	
	VisualStageBox* beatlightAssetBox = this->beatlightAsset.getBox();
	beatlightAssetBox->update(); // VisualStageBox only updates automatically on value changed, after canvas reshape event we have to update manually (before calculating scaleFactor) 
	beatlightAssetBox->setScalingBehaviour(kPreserveAspectRatio);
	
	this->beatlightAsset.generateVertexChain(kFrontVertexChain);

}
Exemplo n.º 3
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);

}
Exemplo n.º 4
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);

}