MCPcopy Create free account
hub / github.com/axmolengine/axmol / updateControlsForContentSize

Method updateControlsForContentSize

core/ui/UIMediaPlayer.cpp:849–868  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

847}
848
849void BasicMediaController::updateControlsForContentSize(const Vec2& contentSize)
850{
851 if (!_controlsReady)
852 return;
853
854 _mediaOverlay->setContentSize(contentSize);
855 _controlPanel->setContentSize(contentSize);
856
857 auto scale = Director::getInstance()->getRenderView()->getScaleY();
858 _primaryButtonPanel->setScale(1 / scale);
859 _timelineTotal->setContentSize(Size(contentSize.width - 40, _timelineBarHeight / scale));
860 _timelineSelector->setContentSize(Size(_timelineBarHeight, _timelineBarHeight) * 1.5f / scale);
861 _fullScreenEnterButton->setScale(1 / scale);
862 _fullScreenExitButton->setScale(1 / scale);
863
864 _fullScreenEnterButton->setPositionNormalized(Vec2());
865 _fullScreenEnterButton->setPositionNormalized(Vec2(0.03f, 0.97f));
866 _fullScreenExitButton->setPositionNormalized(Vec2());
867 _fullScreenExitButton->setPositionNormalized(Vec2(0.03f, 0.97f));
868}
869
870MediaPlayer::MediaPlayer()
871{

Callers

nothing calls this directly

Calls 7

getInstanceFunction · 0.85
SizeFunction · 0.50
Vec2Function · 0.50
setContentSizeMethod · 0.45
getScaleYMethod · 0.45
setScaleMethod · 0.45
setPositionNormalizedMethod · 0.45

Tested by

no test coverage detected