Teena Posted October 14, 2014 Share Posted October 14, 2014 I have an array of points like this, for an example:- (x,y) pairpoints=[30,50,100,20,50,90,120,80,160,20,10] Its is a dot to dot kids game.Means by connecting these points you are drawing a picture.I want to show this picture at the center of game area,keeping in mind all dimensions, android/iphone devices. Now how will i draw points so that image will always look centered for all devices out there?And how the points spread accordingly? Example file attached!Thanks! Quote Link to comment Share on other sites More sharing options...
Sebi Posted October 14, 2014 Share Posted October 14, 2014 Define all points between 0 and 1. Then multiply the points with the desired width/height. e.g. points=[0.2,0.5,0.8,1]width=200height=300 0.2 * 200, 0.5 * 300, 0.8 * 200, 1 * 300 etc That way you can pass any width/height and draw a perfect vector graphic. Quote Link to comment Share on other sites More sharing options...
Teena Posted October 14, 2014 Author Share Posted October 14, 2014 SebastianNette:You r right !Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.