Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Daev · Jul 12, 2010 at 06:49 PM · guitexturetimerscaling

scaling a gui texture

I've asked this on the forum, but haven't been given too much direction yet, hoping for some more information.

In my playerCollision file I set the variable when objects get picked up:

ScoreKeeper.temperatureAdjust = 5 ; 

In my scorekeeper file I apply different textures and track the temperature, displaying a different picture with a higher temperature based on time minus the number from picked up objects that keep things cool.

static var temperatureAdjust : int = 0 ;

function Update () { TemperatureUpdate(); }

function TemperatureUpdate () {

var temperature : int = (Time.time - temperatureAdjust) ;

if ((temperature >= 111 ) && (temperature <= 120)) { guiTexture.texture = temperature12tex; guiTexture.enabled = true ; } else if ((temperature >= 101 ) && (temperature <= 110)) { guiTexture.texture = temperature11tex; }

I'm not quite sure why the above isn't working. The the if statements continue in increments of 10, until it gets to zero, where the game begins.

This is basically an alternative to a timer, based on keeping down the temperature. I'm trying to figure out what might be wrong with this, and also if possible just scale the gui instead of using different textures, because it would be more accurate and require less images to load.

thanks for any help with this.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Daniel 6 · Jul 12, 2010 at 06:54 PM

It is possible to scale a GUITexture by changing it's pixelInset variable. Here's a sample:

guiTexture.pixelInset.width += 20;
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Daev · Jul 14, 2010 at 04:56 AM 0
Share

These are both great ideas.

avatar image
1

Answer by Tetrad · Jul 12, 2010 at 06:51 PM

Instead of using a GUI Texture, consider using just a regular texture on a quad that's either a child of the camera (so it stays in the same place when the camera moves) or rendered using a separate camera. That way you can scale it, move it, or change the material just like any other game object.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Daev · Jul 14, 2010 at 04:56 AM 0
Share

Not sure why I didn't think of this. Thanks!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Textures in GUI being scaled slightly? 1 Answer

How do you auto scale the space between Gui Buttons? 1 Answer

Aspect ratio keeping guitexture scaling 1 Answer

Cooldown indication, transparent rotating texture 1 Answer

Timer progress bar 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges