Welcome,
Guest
. Please
login
or
register
.
April 25, 2025, 02:28:34 PM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
Other Packages
»
[Solved] HUD Text + camera.rect issue
« previous
next »
Print
Pages: [
1
]
Author
Topic: [Solved] HUD Text + camera.rect issue (Read 3902 times)
aprendaGames
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 5
[Solved] HUD Text + camera.rect issue
«
on:
March 31, 2013, 07:05:48 PM »
The game screen is split into 2 parts. The bottom half is all 2d UI, while the top is a 3d scene. To do this I am doing the following on the 3d camera:
camera
.
rect
=
new
Rect
(
0f,
.
39f,1f,
.
61f
)
;
All works fine except that the HUD text shows up in a different spot than what I expected. In fact, it looks a lot like it's in the right spot if the 3d camera took up the whole screen.
Thanks!
«
Last Edit: April 01, 2013, 03:22:29 PM by aprendaGames
»
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: HUD Text + camera.rect issue
«
Reply #1 on:
March 31, 2013, 10:12:27 PM »
The script you're looking for is UIFollowTarget. It converts the coordinates in its Update() function -- lines 87 and 98. Make sure it's using the correct cameras. If it is, then you likely need to make it use the rect there.
Logged
aprendaGames
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 5
Re: HUD Text + camera.rect issue
«
Reply #2 on:
April 01, 2013, 03:21:17 PM »
You are a rock star!
Here's what I did on line 89:
pos
.
y
=
pos
.
y
*
.
61f
+
.
39f
;
It's basically saying that my camera is 61% the size and 39% higher than where it expects it to be. Thanks!
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
Other Packages
»
[Solved] HUD Text + camera.rect issue