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 MohdGasim · Nov 10, 2010 at 04:17 PM · htmlexternaluppop

Pop up window from external source

Hi all...im new to Unity so please be patient...:) I need to develop an educational game...the problem is i have some bookcases with books in them. I would like the mouse to go over a bookcase and when clicked it moves forward dimming the other bookcases...and then another click on a book will open a pop-up with details of that book, which are already in html format on the same server..is there a way to all'this html inside Unity..and not to redirect or open another window....im using the pro license (30 days..so not much time :)..any ideas..please help

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Tarun · Nov 10, 2010 at 09:46 PM

Just an idea. You may want to open a 2D Texture with background image as that book's HTML content. For that to happen, you will need to store the HTML in image format.

So when you click on the book, an object can become visible in front of the camera and that will have the book content as its texture. Clicking on another book can refresh the texture with the other book's content. There are enough APIs to make the object visible disappear or appear when clicked. To move the book forward when clicked, you can use something like this (put this script on the book - change this the way you want - this is just an example):

var wasClicked : boolean;

var targetWall : GameObject; // this is your object that can appear/disappear on book click

function OnMouseDown() {

wasClicked = true;

Activate();

}

function OnMouseUp() {

wasClicked = false;

Deactivate();

}

function OnMouseEnter() {

if (wasClicked) {

 Activate1();  // wasClicked is true - now you want the popup

}

}

function OnMouseExit() {

Deactivate();

}

function Activate() {

renderer.material.color = Color.red; //replace this with lighten up the book's material

// Move the object forward along its z axis 1 unit/second. you can decide whether you want x,y,z movement

transform.Translate(Vector3(0, 0, 1) * Time.deltaTime);

}

function Activate1() {

//Find the object that is disabled - your popup - and make it visible

targetWall.active = true;

// now change its texture

targetWall.renderer.material.mainTexture = Resources.Load("<your HTML page texture>", Texture2D);

}

function Deactivate() {

renderer.material.color = Color.white; //replace this with dim the book's material

// Move the object back along its z axis 1 unit/second.

transform.Translate(Vector3(0, 0, -1) * Time.deltaTime);

}

Comment
Add comment · Show 2 · 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 MohdGasim · Nov 12, 2010 at 06:39 AM 0
Share

Thank you so much...being a newbie has its issues...especially in writing code....thanx again

avatar image MohdGasim · Nov 12, 2010 at 06:41 AM 0
Share

will get to it tonight and give you feedback...

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

create info window 1 Answer

Facebook external eval ? 1 Answer

How to make Jumpscares 0 Answers

How to load html content 2 Answers

Games and websites 1 Answer


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