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

Scaleable GUI elements #20

Open
matshou opened this issue May 24, 2020 · 2 comments
Open

Scaleable GUI elements #20

matshou opened this issue May 24, 2020 · 2 comments
Labels
feature New feature or request

Comments

@matshou
Copy link
Member

matshou commented May 24, 2020

Custom GUI elements should be scalable.

@matshou matshou added the feature New feature or request label May 24, 2020
@matshou
Copy link
Member Author

matshou commented May 24, 2020

@JTK222 provided two implementation samples on MMD:

  • Using AbstractGui.blit method:
blit(double x0, double y0, int destWidth, int destHeight, float u0, float v0, int srcWidth, int srcHeight, int texWidth, int texHeight)
  • Using RenderSystem:
RenderSystem.pushMatrix(); //Push current transformation matrix to the stack
RenderSystem.translate(0, 50, 0); //Ofset the matrix by 50 on the y axis.
//Everything rendered here will be offset 50 pixels downwards when in a gui
RenderSystem.popMatrix(); //Reset the matrix to the state of the last pushMatrix

@matshou
Copy link
Member Author

matshou commented May 24, 2020

Reference to mapped blit parameters:
https://gist.github.com/gigaherz/f61fe604f38e27afad4d1553bc6cf311

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

No branches or pull requests

1 participant