Comments (3)
Hi @Toemsel,
Thank you for the suggestion.
What effect are you trying to achieve with transformations? If you need scaling you should use UserInterface.Active.GlobalScale
. Scaling with matrix won't be "anchors aware", eg if you scale up entities will start going off screen, while using UserInterface.Active.GlobalScale
scale in a smart way that keeps everything in borders.
Using transformations can help you achieve one of the following effects: rotate around X axis (rotation z and y won't work) and translation.
I added transformations support, but it wasn't as simple as it sound because the transformation should also affect cursor position to detect clicks etc. Merely exporting the spritebatch transformation matrix would result in bad clicking detection.
Anyway here's the commit, in dev branch:
- few other commits after it.
You use it like this:
UserInterface.Active.RenderTargetTransformMatrix = someMatrix;
.
Few more things you need to be aware of when using this:
- You have to use render targets for it to work (see this https://github.com/RonenNess/GeonBit.UI#using-render-targets)
- You need to decide if you want the cursor to be affected by transformations or not. eg. is cursor will be rendered in normal space, or transformed. You can change the behavior with
UserInterface.Active.IncludeCursorInRenderTarget
.
I don't know when next nuget version be so if you want this feature now you should fetch dev branch and build locally.
Let me know if you need any additional help.
Cheers!
from geonbit.ui.
Wow, fast answer and fix! π
I do not try to scale nor transform the GUI in any way. While working with a 3D camera, the GUI does not adapt to the global world camera. (How should it) In a normal case that wouldn't be required, but I attach GUI elements (buttons) on world objects, which aren't in the ViewPort. Thus, transforming the ViewMatrix also should apply to the GUI. (In my special case). Therefore, I thought about a Transformation Matrix in your library.
Thanks for the fast fix! That did the trick
from geonbit.ui.
To combine the UI in 3d space you can also use render targets and instead of drawing the render target using sprites batch use it as a texture on a 3d object.
Although this will require manipulating the cursor position in a more tricky way currently not supported.
Anyway glad the fix helped, have fun :)
from geonbit.ui.
Related Issues (20)
- Support for MonoGame 3.7.x HOT 1
- Crash in example app, attempts to draw a panel of height 443809248 HOT 1
- netcoreοΌ HOT 7
- MonoGame 3.8 HOT 1
- Support for non-monospace fonts HOT 3
- Change docs in relation to moving Content HOT 1
- Extra steps for Linux necessary for Windows too HOT 3
- State dependent UI-rendering HOT 1
- Analog of divs in HTML HOT 1
- Preventing in-game click fall through GenoBit.UI entities HOT 4
- Removing non-root entities (inside parent) HOT 5
- Implementing inventory HOT 14
- monogame 3.8? HOT 1
- Question about install HOT 1
- Problem with custom font and rich texts. HOT 11
- Could not resolve data type. HOT 3
- Exception during Initialize HOT 1
- NuGet Installation Documenation Is Misleading HOT 1
- Font-less version of GeonBit? HOT 5
- Absolute -> relative positioning HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geonbit.ui.