Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - wiley.a

Pages: [1]
1
Support / Screen Rotation Problem
« on: November 01, 2012, 03:10:49 pm »
Hello

In the game I am working on we have both horizontal and vertical based levels. I want to be able to switch the camera's setup so that it displays horizontally on iOS when on a horizontal level but set it in portrait mode when on a vertical level. I am sure its simple to do this but I am obviously missing something. The horizontal setup works fine but that could be because most of the game is in horizontal. When the vertical code runs everything is rendered vertically (so portrait on the device) but it has massive pillar boxing going on. I'd post a screenshot but I can't, sorry. Hope I have explained it well enough.

Code: [Select]
public static void SwitchCameraTo(Orientation orientation)
{
// If the orientation is already correct, return early
if (orientation == GameController.CameraOrientation)
return;

GameController.CameraOrientation = orientation;

if (orientation == Orientation.Horizontal)
{
GameController.Camera.nativeResolutionWidth = 960;
GameController.Camera.nativeResolutionHeight = 640;

GameController.Camera.forceResolution = new Vector2(960, 640);

Screen.orientation = ScreenOrientation.LandscapeLeft;
}
else
{
GameController.Camera.nativeResolutionWidth = 640;
GameController.Camera.nativeResolutionHeight = 960;

GameController.Camera.forceResolution = new Vector2(640, 960);

Screen.orientation = ScreenOrientation.Portrait;
}
}

2
Support / Automatically transfer a sprite between atlases?
« on: October 08, 2012, 02:31:32 pm »
Hello

Is it possible to script the transfer of a sprite between atlases and then regenerate both?

Thanks

Pages: [1]