MCPcopy Create free account
hub / github.com/Cpasjuste/pplay / ScrapView

Method ScrapView

src/filer/scrap_view.cpp:12–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10using namespace c2d;
11
12ScrapView::ScrapView(Main *m, const c2d::FloatRect &rect) : Rectangle(rect) {
13
14 main = m;
15
16 // backdrop
17 backdrop = new Sprite();
18 backdrop->setOrigin(Origin::BottomRight);
19 backdrop->setPosition(ScrapView::getSize());
20 backdrop->setVisibility(Visibility::Hidden);
21 backdrop->setAlpha(0);
22 backdrop->add(new TweenAlpha(0, 255, 0.3f));
23 ScrapView::add(backdrop);
24
25 // backdrop fade
26 fade = new C2DTexture(main->getIo()->getRomFsPath() + "skin/fade.png");
27 fade->setOrigin(Origin::BottomRight);
28 fade->setPosition(backdrop->getPosition());
29 fade->setFillColor(Color::Black);
30 ScrapView::add(fade);
31
32 // poster
33 poster = new Sprite();
34 poster->setPosition(main->getScaled(64, 32));
35 poster->setVisibility(Visibility::Hidden);
36 poster->setAlpha(0);
37 poster->add(new TweenAlpha(0, 255, 0.3f));
38 ScrapView::add(poster);
39
40 Vector2f pos{poster->getPosition().x + (216 * main->getScaling().x),
41 poster->getPosition().y + (10 * main->getScaling().y)};
42 Vector2f size{ScrapView::getSize().x - pos.x - (16 * main->getScaling().x), 180 * main->getScaling().y};
43
44 // title
45 title = new C2DText("TITLE", main->getFontSize(Main::FontSize::Big), main->getFont());
46 title->setPosition({pos.x, pos.y});
47 ScrapView::add(title);
48
49 // text
50 overview = new C2DText("", main->getFontSize(Main::FontSize::Small), main->getFont());
51 overview->setFillColor(COLOR_FONT);
52 overview->setPosition(pos.x, pos.y + (70 * main->getScaling().y));
53 overview->setOverflow(Text::NewLine);
54 overview->setSizeMax(size.x, size.y);
55 ScrapView::add(overview);
56
57 resolution_icon = new TextIcon("1080p", main->getFontSize(Main::FontSize::Small), main->getFont());
58 resolution_icon->setPosition(pos.x, (80 * main->getScaling().y));
59 ScrapView::add(resolution_icon);
60 video_icon = new TextIcon("h264", main->getFontSize(Main::FontSize::Small), main->getFont());
61 video_icon->setPosition(pos.x + (64 * main->getScaling().x), (80 * main->getScaling().y));
62 ScrapView::add(video_icon);
63 audio_icon = new TextIcon("DTS", main->getFontSize(Main::FontSize::Small), main->getFont());
64 audio_icon->setPosition(pos.x + (64 * main->getScaling().x) * 2, (80 * main->getScaling().y));
65 ScrapView::add(audio_icon);
66 subs_icon = new TextIcon("SUBS", main->getFontSize(Main::FontSize::Small), main->getFont());
67 subs_icon->setPosition(pos.x + (64 * main->getScaling().x) * 3, (80 * main->getScaling().y));
68 ScrapView::add(subs_icon);
69

Callers

nothing calls this directly

Calls 9

getRomFsPathMethod · 0.80
getPositionMethod · 0.80
getScaledMethod · 0.80
getScalingMethod · 0.80
getFontSizeMethod · 0.80
getFontMethod · 0.80
setVisibilityMethod · 0.45
setAlphaMethod · 0.45
setFillColorMethod · 0.45

Tested by

no test coverage detected