Welcome,
Guest
. Please
login
or
register
.
April 29, 2026, 12:36:07 PM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Texture doesn't load properly for some reason
« previous
next »
Print
Pages: [
1
]
Author
Topic: Texture doesn't load properly for some reason (Read 4165 times)
richardwood
Newbie
Thank You
-Given: 2
-Receive: 0
Posts: 8
Texture doesn't load properly for some reason
«
on:
August 23, 2014, 02:30:06 PM »
Hello, I'm currently stuck on this part. Basically I want this box to load image from url
This is my snippet
void
Start
(
)
{
StartCoroutine
(
SetAvatar
(
)
)
;
}
IEnumerator SetAvatar
(
)
{
while
(
true
)
{
if
(
avatarLoaded
==
false
&&
PlayerObjectScript
.
display_pic
!=
""
)
{
Texture2D ava
=
new
Texture2D
(
50
,
50
, TextureFormat
.
DXT1
,
false
)
;;
var
www
=
new
WWW
(
PlayerObjectScript
.
display_pic
)
;
www
.
LoadImageIntoTexture
(
ava
)
;
this
.
GetComponent
<
UITexture
>
(
)
.
mainTexture
=
ava
;
avatarLoaded
=
true
;
}
else
{
yield
return
null
;
}
}
}
PlayerObjectScript.display_pic this var is this link:
http://puu.sh/3c74g.png
This is the result
anyone know why it become lines like that??
Thanks!
Logged
Ace
Newbie
Thank You
-Given: 4
-Receive: 0
Posts: 24
Re: Texture doesn't load properly for some reason
«
Reply #1 on:
August 23, 2014, 07:03:45 PM »
Hi
I've had issues like this before too. I noticed if I had a texture sheet above 2048x2048 this came up.
Is your texturesheet bigger than that?
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Texture doesn't load properly for some reason
«
Reply #2 on:
August 23, 2014, 08:14:10 PM »
Is the texture actually DXT1-compressed? My guess is that it isn't. You should try specifying ARGB32 instead.
Also, you might want to yield until the download completes, and only then set the mainTexture.
Logged
richardwood
Newbie
Thank You
-Given: 2
-Receive: 0
Posts: 8
Re: Texture doesn't load properly for some reason
«
Reply #3 on:
August 23, 2014, 09:21:07 PM »
thank you, that's fixed it, changing the compression, and wait till the www has done downloading the data
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Texture doesn't load properly for some reason