Closed Gandifil closed 10 months ago
Hi! This is not an issue with the library, it's just about how the Image
element works: The size of the element itself doesn't necessarily have to correspond to the size of the texture that it displays. This may be a bit confusing, but is the intended behavior!
If you want an easy way to deal with this issue for your situation, I recommend upgrading to the prerelease versions of MLEM (more info in the README!), where I recently introduced the SetWidthBasedOnAspect
and SetHeightBasedOnAspect
properties for images (https://github.com/Ellpeck/MLEM/commit/294af052ae313e1dabd3c9ac098b2ee32b155e66). These allow setting a fixed or percentual width (or height), and then having the height (or width) automatically adjust itself so that the image element's size matches the texture it displays exactly.
Let me know if that answered your question :))
Thanks you! SetWidthBasedOnAspect
and SetHeightBasedOnAspect
are literally what I meant and what I wanted.
Hi!
You have written that coder can use
DisplayArea
for mouse input handle.I don't set size vector for image exactly, and have got this:
Red rectangle -
DisplayArea
Blue rectangle - what I mean realDisplayArea
.So, if i try to check mouse events I can't see real image area. If I will use
scaleToImage
, it makes image too big, because asset is hi-res.