game/mario/edit_box.cpp

27 lines
799 B
C++
Raw Normal View History

2021-05-02 12:14:11 +00:00
#include "edit_box.hpp"
2021-05-07 07:43:57 +00:00
#include "objectids.hpp"
#include "blocks.hpp"
#include "sprites.hpp"
2021-05-02 12:14:11 +00:00
2021-10-18 07:08:35 +00:00
EditBox::EditBox(int x, int y, float start_x, float start_y, int map_width,
int map_height, std::shared_ptr<SDLPP::Renderer> renderer)
: SDLPP::RectangleRender(start_x + x * BLOCK_SIZE,
start_y + y * BLOCK_SIZE, BLOCK_SIZE,
BLOCK_SIZE, renderer) {
2021-05-02 12:14:11 +00:00
_x = x;
_y = y;
setId(EDITOR_EDIT_SQUARE);
setColiderColor("#FF00AA");
setPermanent();
setAlignment(SDLPP::OBJ_CENTER, SDLPP::OBJ_CENTER);
2021-10-18 07:08:35 +00:00
addCollision(SDLPP::RectColider(0, 0, 1, 1));
2021-05-02 12:14:11 +00:00
}
SDLPP::Vec2D<int> EditBox::getIndexes() const {
2021-10-18 07:08:35 +00:00
return { _x, _y };
2021-05-02 12:14:11 +00:00
}
2021-10-18 07:08:35 +00:00
void EditBox::visit(SDLPP::Visitor &visitor) {
visitor.visit(*this);
2021-05-02 12:14:11 +00:00
}