x


iPhone Touch Screen?

Do I need to change all of my scripts to make it work for the iPhone? Or should it work anyways? These are the kind of scripts I am using:

function OnGUI () {

GUI.Box (Rect (350,200,190,150), "");

if (GUI.Button (Rect (360,210,170,30), "New Game")) { Application.LoadLevel (3); }

if (GUI.Button (Rect (360,250,170,30), "Level Select")) { Application.LoadLevel (1); }

if (GUI.Button (Rect (360,290,170,30), "Tutorial")) { Application.LoadLevel (2); }

}

Does this work on iPhone? Thx

more ▼

asked Jul 13, 2010 at 07:56 PM

Collinbxyz gravatar image

Collinbxyz
114 51 50 58

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

It will work - but it won't be fast. You should avoid all OnGui calls on iPhone for the sake of speed :)

more ▼

answered Sep 08, 2010 at 06:32 AM

jtbentley gravatar image

jtbentley
624 8 10 27

I've been using OnGUI for most of my menu and HUD in iPhone without much complaint. However, this is a very good article and I will certainly be rethinking my GUI approach.

Sep 22, 2010 at 03:22 PM karl_

Indeed it won't be fast at all. Here's an article with details... http://www.mindthecube.com/blog/2010/09/avoiding-performance-cost-of-ongui

Sep 22, 2010 at 01:58 PM equalsequals
(comments are locked)
10|3000 characters needed characters left

It works.

Next time why don't you just try it instead of asking? (Unless you don't have it yet)

more ▼

answered Jul 13, 2010 at 07:59 PM

MikezNesh gravatar image

MikezNesh
993 181 150 166

Ok that's cool.

Jul 13, 2010 at 08:15 PM MikezNesh

I don't have unity iPhone yet. I will get it when I finish. I know it works for PC, but didn't know if it would work on iPhone. Got it?

Jul 13, 2010 at 08:06 PM Collinbxyz
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5917
x2226
x1377
x1194
x425

asked: Jul 13, 2010 at 07:56 PM

Seen: 3244 times

Last Updated: Sep 08, 2010 at 06:32 AM