YAPOG  0.0.1
Yet Another Pokemon Online Game
PictureBox.cpp
Go to the documentation of this file.
6 
7 namespace yap
8 {
10  : picture_ (nullptr)
11  {
12  }
13 
15  {
16  }
17 
19  {
20  return Vector2 (
23  + ((border_ != nullptr) ? border_->GetSize () : Vector2 ());
24  }
25 
27  {
28  return false;
29  }
30 
32  {
33  picture_->Draw (context);
34  }
35 
36  void PictureBox::HandleShow (bool isVisible)
37  {
38  }
39 
40  void PictureBox::HandleMove (const Vector2& offset)
41  {
42  picture_->Move (offset);
43  //picture_->SetPosition (GetPosition() + offset);
44  }
45 
46  void PictureBox::HandleScale (const Vector2& factor)
47  {
48  Vector2 base = picture_->GetSize ();
49  Vector2 neo (base.x * factor.x, base.y * factor.y);
50 
51  picture_->SetSize (neo);
52  }
53 
54  void PictureBox::HandleUpdate (const Time& dt)
55  {
56  }
57 
58  void PictureBox::HandleChangeColor (const sf::Color& color)
59  {
60  picture_->ChangeColor (color);
61  }
62 
64  {
65  return *picture_;
66  }
67 
69  {
70  if (picture_ != nullptr)
71  delete picture_;
72 
73  picture_ = picture;
74 
76  GetPosition ().y + padding_.top));
77 
79  }
80 } //namespace yap