World To Screen: Difference between revisions

From Fancade Wiki
(Created page with "Given a world coordinate, outputs its screen coordinates. /uploads/World To Screen.png = Notes = Due to a technical issue, still to be fixed, the output lags by one frame. I.e. if you Set Camera on frame N, then this block's output will change on frame N+1. Because of this bug, the script will not work on the first frame. To avoid incorrect values, use the block's output if the Current Frame is greater than 0. Category:Block...")
 
m (Use infobox)
Line 1: Line 1:
{{Block
|image=World To Screen.png
|type=s
|folder=Math
|input1={{Port|v|World Pos}}
|output1={{Port|n|Screen X}}
|output2={{Port|n|Screen Y}}
}}
Given a world coordinate, outputs its screen coordinates.
Given a world coordinate, outputs its screen coordinates.


[[width=336px,alt=World To Screen|/uploads/World To Screen.png]]
== Notes ==


= Notes =
Due to a technical issue, still to be fixed, the output lags by one frame. I.e. if you [[Set Camera]] on frame N, then this block's output will change on frame N+1.
Due to a technical issue, still to be fixed, the output lags by one frame. I.e. if you Set Camera on frame N, then this block's output will change on frame N+1.


Because of this bug, the script will not work on the first frame. To avoid incorrect values, use the block's output if the [[Current Frame]] is greater than 0.
Because of this bug, the script will not work on the first frame. To avoid incorrect values, use the block's output if the [[Current Frame]] is greater than 0.


[[Category:Blocks]]
[[Category:Blocks]]

Revision as of 11:57, 20 May 2024

World To Screen
World To Screen.png
TypeScript block
ColliderNone
FolderMath
Ports
Inputs World Pos
Outputs Screen X
Screen Y

Given a world coordinate, outputs its screen coordinates.

Notes

Due to a technical issue, still to be fixed, the output lags by one frame. I.e. if you Set Camera on frame N, then this block's output will change on frame N+1.

Because of this bug, the script will not work on the first frame. To avoid incorrect values, use the block's output if the Current Frame is greater than 0.