Welcome,
Guest
. Please
login
or
register
.
April 22, 2026, 03:55:23 PM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
space between the sprite / NGUI
« previous
next »
Print
Pages: [
1
]
Author
Topic: space between the sprite / NGUI (Read 2271 times)
kikuchi
Guest
space between the sprite / NGUI
«
on:
October 01, 2012, 10:25:20 PM »
Hi,
I am trying to display an object of sprite using the three.
Input correct pixel, scale, but space between the sprite on the iPhone.
Parent
=
(
GameObject
)
Instantiate
(
ParentPrefab,
new
Vector3
(
0
,
0
,
0
)
,Quaternion
.
identity
)
;
Parent
.
transform
.
parent
=
UIRootPanel
.
transform
;
Parent
.
transform
.
localScale
=
new
Vector3
(
1
.
0f,1
.
0f,1
.
0f
)
;
Parent
.
transform
.
localPosition
=
new
Vector3
(
0
.
0f,0
.
0f,0
.
0f
)
;
GameObject child_1
=
Parent
.
transform
.
FindChild
(
"Child_1"
)
.
gameObject
;
// sprite from atlas
child_1
.
transform
.
localScale
=
new
Vector3
(
58
.
0f, 64
.
0f, 1
.
0f
)
;
child_1
.
transform
.
localPosition
=
new
Vector3
(
0
.
0f, 100
.
0f, 1
.
0f
)
;
GameObject child_2
=
Parent
.
transform
.
FindChild
(
"Child_2"
)
.
gameObject
;
// sprite from atlas
child_2
.
transform
.
localScale
=
new
Vector3
(
15
.
0f, 64
.
0f, 1
.
0f
)
;
child_2
.
transform
.
localPosition
=
new
Vector3
(
58
.
0f, 100
.
0f, 1
.
0f
)
;
GameObject child_3
=
Parent
.
transform
.
FindChild
(
"Child_3"
)
.
gameObject
;
// sprite from atlas
child_3
.
transform
.
localScale
=
new
Vector3
(
34
.
0f, 64
.
0f, 1
.
0f
)
;
child_3
.
transform
.
localPosition
=
new
Vector3
(
73
.
0f, 100
.
0f, 1
.
0f
)
;
How do does it work?
Thanks.
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: space between the sprite / NGUI
«
Reply #1 on:
October 01, 2012, 11:52:03 PM »
I'm lost and confused by the code. What's with all the hard-coded numbers? Have you tried simply using a UITable?
Logged
kikuchi
Guest
Re: space between the sprite / NGUI
«
Reply #2 on:
October 02, 2012, 07:33:10 AM »
I want to display a variable-length-bar, by extending the "Child_2".
I'll try using UITable, anyway!
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
space between the sprite / NGUI