Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-26-2011, 06:01 PM   #1 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 1
chrisj.leaf is on a distinguished road
Question Strange HTML5 Rotating Error for iTouch

I am trying to develop an app that is supported at least on an iTouch Version 4.3.4 (8K2) which is comprised almost entirely of a Canvas element upon which objects are drawn. The graphics display flawlessly when I do it on my normal browsers and even when I use the iTouch's Safari, but as soon as I try to clip it to the desktop (because it is designed perfectly to be run fullscreen) it causes errors due to image rotation. When rotation is removed from the process of drawing it again works fine.

Code:
     //Canvas size 320x480	
     var x, y // Some variables on the scale of 0 to 100
      var alpha //Some angle, in radians
	ctx.save(); 
					
	//Bring to 0,0 and rotate
	ctx.translate(x,y);					
	ctx.rotate(alpha);
	ctx.translate(-x,-y);
					
	ctx.drawImage(car, ...); // You get the point
					
	//Restore Canvas Context for next draw
	ctx.translate(x,y);
	ctx.rotate(-alpha);
	ctx.translate(-x,-y);
	ctx.restore();
The variables above are defined elsewhere, and I left out some details I figured would be useless.

The issue is that the canvas will remain rotated when run from the iTouch's home page, usually after drawing itself three times in the background (I can tell by the fact I can see 3 canvas in the background of different orientations).

I thought it might be due to a large amount of processing for the iTouch to do so I set the frame rate to 5 seconds and although it shows less of a rotation effect it still does.

Any hints of what I could try to fix this? It looks pretty dull when all cars are pointing forward no matter what direction they drive..
chrisj.leaf is offline   Reply With Quote
Reply

Bookmarks

Tags
canvas, html5, itouch, rotation

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 404
14 members and 390 guests
7twenty7, blasterbr, buggen, chiataytuday, dre, fiftysixty, HemiMG, jimmyon122, jonathandeknudt, LEARN2MAKE, nyoe, pungs, tymex, UMAD
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,668
Threads: 94,121
Posts: 402,902
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jonathandeknudt
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:01 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0