YAPOG  0.0.1
Yet Another Pokemon Online Game
VerticalLayout.cpp
Go to the documentation of this file.
5 
6 namespace yap
7 {
8 
10  : LayoutBox ()
11  {
12  }
13 
15  : LayoutBox (ext, in, isExt)
16  {
17  }
18 
20  {
21  for (auto itMap = items_.begin (); itMap != items_.end (); itMap++)
22  return (*itMap).first->GetSize ().y;
23  return 0;
24  }
25 
27  {
28  }
29 
31  {
32  float totalPad = 0;
33 
34 
35  if (globalAlign_ == Align::BOTTOM)
36  totalPad = GetSize ().y - externPad_.bottom;
37  else if (globalAlign_ == Align::CENTER)
38  totalPad = (GetSize ().y - externPad_.bottom - externPad_.top) / 2
39  + externPad_.top;
40  else
41  totalPad = externPad_.top;
42 
43 
44  float leftAlign = externPad_.left;
45  float rightAlign = GetSize ().x - externPad_.right;
46  float midAlign = (GetSize ().x - externPad_.right - externPad_.left) / 2
47  + externPad_.left;
48 
49  for (IWidget* child : childen_)
50  {
51  child->SetPosition (GetPosition ());
52 
53  float posX = 0;
54  if (items_[child] == Align::LEFT)
55  posX = leftAlign;
56  else if (items_[child] == Align::RIGHT)
57  posX = rightAlign - child->GetSize ().x;
58  else
59  posX = midAlign - (child->GetSize ().x / 2);
60 
61  Vector2 currentPos (posX, totalPad);
62  child->Move (currentPos);
63 
64  totalPad += child->GetSize ().y + innerPad_.bottom;
65  }
68  , GetUserSize ().y/* spatialInfo_.GetSize ().y*/);
69  realSize_.x = MaxSize ('x');
71  }
72 
74  {
75  }
76 
77  void VerticalLayout::HandleShow (bool isVisible)
78  {
79  }
80 
81  void VerticalLayout::HandleMove (const Vector2& offset)
82  {
83  }
84 
85  void VerticalLayout::HandleScale (const Vector2& factor)
86  {
87  }
88 
90  {
91  }
92 
93  void VerticalLayout::HandleChangeColor (const sf::Color& color)
94  {
95  }
96 } //namespace yap