-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mashdev #34
base: dev
Are you sure you want to change the base?
Conversation
…usar corretamente a nova Sprite, que é componente
…enums separadas no jogo e na engine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Anders1232, vc está de acordo com minhas observações?
|
||
Com a associação, caso o objeto pai seja movimentado, o objeto filho terá sua posição atualizada de acordo, afim de manter o posicionamento relativo. | ||
*/ | ||
void SetParent(GameObject& parent, int xrelative = 0, int yrelative = 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mashiro11, não entendi a necessidade do offset nesse método. Não seria melhor, para obedecer o princípio de Separation Of Concerns, manter esse método alterando somente o Parent
e logo depois usar a função SetPosition
?
Acredito que a falta de um componente Transform
(e o RectTransform
herdar dele) está complicando a nossa vida hahaha
\brief Retorna true caso haja um click dentro da área do rect. | ||
*/ | ||
bool Clicked(){return clicked;}; | ||
bool Released(){return released;}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eu entendo o que você quis fazer aqui. Mas pq vc não quis deixar sem isso e adicionar um componente Button
aos GOs que vc precisa que tenham esse comportamento? Pergunto só por curiosidade mesmo.
void SetAnchors( Vec2 topLeft, Vec2 bottomRight ); | ||
void SetOffsets( float up, float right, float down, float left ); | ||
void SetCenterPin( Vec2 center = {0.5, 0.5} ); | ||
void SetKernelSize(float w, float h); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ao invés de criar essa função (e a SetAnchors
) usando os valores destrinchados, que tal usar os originais mas usando brace initialized list?
Assim, se você quisesse fazer SetKernelSize( 0.5, 0.5 )
usando somente o método que recebe Vec2 bastaria escrever SetKernelSize({ 0.5, 0.5 })
.
Outro exemplo, se você quiser chamar SetAnchors( 0.2, 0.2, 0.8, 0.8 )
usando o método que receber dois Vec2, bastaria você usar SetAnchors( {0.2, 0.2}, {0.8, 0.8} )
.
Se você consegue usar dessa forma, não há necessidade da criação desses overloads. Agora se não é possível, eu gostaria de saber quais situações te motivaram a fazer esses métodos...
@@ -46,7 +46,8 @@ RMDIR= rd /s /q | |||
RM = del /q | |||
|
|||
#path da SDL | |||
SDL_PATHS = C:/SDL2/x86_64-w64-mingw32 C:/Tools/msys64/mingw64 | |||
SDL_ALL_PATH = C:/SDL2/SDL2all | |||
SDL_PATHS = C:/SDL2/x86_64-w64-mingw32 C:/Tools/msys64/mingw64 $(SDL_ALL_PATH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pq teve que colocar o SDL2all numa variável diferente? Colocar SDL_PATHS = C:/SDL2/x86_64-w64-mingw32 C:/Tools/msys64/mingw64 C:/SDL2/SDL2all
estava dando problema?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isso foi para resolver um problema de compilação que estávamos tendo. Colocamos numa variável separada para isolar nossa modificação.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood. Vou marcar para eu depois dar uma olhada nisso.
Edit: Marcado em #35.
…t totalmente resolvida
… o componente herda daquela classe; caso positivo, retorna
Alteração de assinatura de Sprite e outras cositas.