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

Method init

core/ui/UIScrollViewBar.cpp:87–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87bool ScrollViewBar::init()
88{
89 if (!ProtectedNode::init())
90 {
91 return false;
92 }
93
94 _upperHalfCircle = utils::createSpriteFromBase64Cached(HALF_CIRCLE_IMAGE, HALF_CIRCLE_IMAGE_KEY);
95 _upperHalfCircle->setAnchorPoint(Vec2::ANCHOR_MIDDLE_BOTTOM);
96 addProtectedChild(_upperHalfCircle);
97
98 _lowerHalfCircle = Sprite::createWithTexture(_upperHalfCircle->getTexture(), _upperHalfCircle->getTextureRect(),
99 _upperHalfCircle->isTextureRectRotated());
100 _lowerHalfCircle->setScaleY(-1);
101 _lowerHalfCircle->setAnchorPoint(Vec2::ANCHOR_MIDDLE_BOTTOM);
102 addProtectedChild(_lowerHalfCircle);
103
104 _body = utils::createSpriteFromBase64Cached(BODY_IMAGE_1_PIXEL_HEIGHT, BODY_IMAGE_1_PIXEL_HEIGHT_KEY);
105 _body->setAnchorPoint(Vec2::ANCHOR_MIDDLE_BOTTOM);
106 addProtectedChild(_body);
107
108 setColor(DEFAULT_COLOR);
109 onScrolled(Vec2::ZERO);
110 ProtectedNode::setOpacity(0);
111 _autoHideRemainingTime = 0.0f;
112
113 if (_direction == ScrollView::Direction::HORIZONTAL)
114 {
115 setRotation(90);
116 }
117 return true;
118}
119
120void ScrollViewBar::setPositionFromCorner(const Vec2& positionFromCorner)
121{

Callers 1

createMethod · 0.45

Calls 8

setColorFunction · 0.85
setOpacityFunction · 0.85
initFunction · 0.50
setRotationFunction · 0.50
setAnchorPointMethod · 0.45
getTextureMethod · 0.45
setScaleYMethod · 0.45

Tested by

no test coverage detected