CLIP_RECT do not take into account the rotation of the sprite before culling it
The CLIP_RECT will vanishe the Sprite it if a non-rotated variant of the size of this sprite is outside CLIP_RECT bounding Box
Rectangles were supposed to appear in the empty spaces in the image below, but as it would be "out" of the clip rect if it had no rotation, it is removed from the image
for example, the SAME image, but if i remove the CLIP_RECT
In Another Example:
Thanks Digi#9441 for this code for replicating
Require:
Some type of Control Seat (ensure the name is exactly "Flight Seat")
A Power Source
A Programable Block
Vector2 CursorPos; public Program() { Runtime.UpdateFrequency = UpdateFrequency.Update10; IMyTextSurface surface = Me.GetSurface(0); CursorPos = surface.SurfaceSize / 2; } public void Main(string argument, UpdateType updateType) { IMyShipController ctrl = (IMyShipController)GridTerminalSystem.GetBlockWithName("Flight Seat"); IMyTextSurface surface = Me.GetSurface(0); surface.ContentType = ContentType.SCRIPT; CursorPos += new Vector2(ctrl.RotationIndicator.Y, ctrl.RotationIndicator.X) * 5; using(var frame = surface.DrawFrame()) { RectangleF viewport = new RectangleF((surface.TextureSize - surface.SurfaceSize) / 2f, surface.SurfaceSize); CursorPos = Vector2.Clamp(CursorPos, viewport.Center - (viewport.Size / 2), viewport.Center + (viewport.Size / 2)); frame.Add(new MySprite(SpriteType.TEXTURE, "SquareSimple", viewport.Center, viewport.Size / 2)); frame.Add(new MySprite(SpriteType.CLIP_RECT, null, viewport.Center - (viewport.Size / 4), viewport.Size / 2)); frame.Add(new MySprite(SpriteType.TEXTURE, "SquareSimple", CursorPos, new Vector2(5, 100), Color.Red, rotation: MathHelper.ToRadians(45))); frame.Add(new MySprite(SpriteType.TEXTURE, "SquareSimple", CursorPos, new Vector2(100, 5), Color.Blue, rotation: MathHelper.ToRadians(45))); }}
both lines have 100px but the Red one have it on Y-axis, and Blue one on X-axis rotated to be 45º
The Blue one disapear if the cursor touch both ends of the Y-axis
and the Red one disapear if the cursor touch both ends of the X-axis
Hello, Arthur,
thanks for letting us know.
I seems to have and issue with reproduction of the last steps. Can you please provide more information?
How do I "touch" end with the cursor? The ends of what? With what cursor? How I can reproduce it in the game?
Can you please share me exact steps to reproduce? Also a video showing this issue will be good – there is better chance to reproduce it for me if I can see your process and repeat it on my end.
It would also eas my work if you can share whole save file right away, where everything is already set.
Please send me the save file with the affected grid, or at least a blueprint.
For saves:
You can access your save files by typing %appdata% into your Windows search bar and you will be redirected to the hidden Roaming folder. After that just follow: \Roaming\SpaceEngineers\Saves. There should be a folder with your SteamID and your saves.
Please zip the file and attach it here. If you are having difficulty attaching files you can optionally use Google Drive. When sharing a google drive link please make sure it is set to be downloadable by anyone with the link.
For blueprint:
You can access your blueprints files by typing %appdata% into your Windows search bar and you will be redirected to the hidden Roaming folder. After that just follow: \Roaming\SpaceEngineers\Blueprints. Select the correct folder where your blueprint is saved (local or cloud), zip the file and attach it here.
Thanks in advance.
Kind Regards
Keen Software House: QA Department
Hello, Arthur,
thanks for letting us know.
I seems to have and issue with reproduction of the last steps. Can you please provide more information?
How do I "touch" end with the cursor? The ends of what? With what cursor? How I can reproduce it in the game?
Can you please share me exact steps to reproduce? Also a video showing this issue will be good – there is better chance to reproduce it for me if I can see your process and repeat it on my end.
It would also eas my work if you can share whole save file right away, where everything is already set.
Please send me the save file with the affected grid, or at least a blueprint.
For saves:
You can access your save files by typing %appdata% into your Windows search bar and you will be redirected to the hidden Roaming folder. After that just follow: \Roaming\SpaceEngineers\Saves. There should be a folder with your SteamID and your saves.
Please zip the file and attach it here. If you are having difficulty attaching files you can optionally use Google Drive. When sharing a google drive link please make sure it is set to be downloadable by anyone with the link.
For blueprint:
You can access your blueprints files by typing %appdata% into your Windows search bar and you will be redirected to the hidden Roaming folder. After that just follow: \Roaming\SpaceEngineers\Blueprints. Select the correct folder where your blueprint is saved (local or cloud), zip the file and attach it here.
Thanks in advance.
Kind Regards
Keen Software House: QA Department
hello???
hello???
Hello, Arthur,
thanks for all the info and provided save.
Issue was successfully reproduced and put into our internal system.
Kind Regards
Keen Software House: QA Department
Hello, Arthur,
thanks for all the info and provided save.
Issue was successfully reproduced and put into our internal system.
Kind Regards
Keen Software House: QA Department
After a little more research, I found another related problem, Sprites that inverted (X or Y as a negative value) also suffer from this problem
As usual, here's an example script, just put on a programable block and look to the screen:
Video Attached
Expected.mp4 is without a clip_rect
(To do so, delete the line 12 on the code: frame.Add(new MySprite(SpriteType.CLIP_RECT, null, viewport.Center - (viewport.Size / 3), viewport.Size / 1.5f)); )
Results.mp4 is WITH a clip_rect
After a little more research, I found another related problem, Sprites that inverted (X or Y as a negative value) also suffer from this problem
As usual, here's an example script, just put on a programable block and look to the screen:
Video Attached
Expected.mp4 is without a clip_rect
(To do so, delete the line 12 on the code: frame.Add(new MySprite(SpriteType.CLIP_RECT, null, viewport.Center - (viewport.Size / 3), viewport.Size / 1.5f)); )
Results.mp4 is WITH a clip_rect
Replies have been locked on this page!