Skip to content
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

Open
wants to merge 51 commits into
base: dev
Choose a base branch
from
Open

Mashdev #34

wants to merge 51 commits into from

Conversation

mashiro11
Copy link
Collaborator

Alteração de assinatura de Sprite e outras cositas.

Anders1232 and others added 30 commits July 25, 2017 15:28
…usar corretamente a nova Sprite, que é componente
Copy link
Collaborator

@bestknighter bestknighter left a 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);
Copy link
Collaborator

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;};
Copy link
Collaborator

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);
Copy link
Collaborator

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)
Copy link
Collaborator

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?

Copy link
Owner

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.

Copy link
Collaborator

@bestknighter bestknighter Dec 30, 2017

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.

@Anders1232
Copy link
Owner

@mashiro11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants