void Awake() { canvas = gameObject.GetComponent <CanvasController>(); Rect camRect = new Rect(screenOffset.left, screenOffset.bottom, Screen.width - screenOffset.horizontal, Screen.height - screenOffset.vertical); canvasConfig = canvas.config; if (texture == null) { canvasConfig.canvasSize = new IntVector2(1024, 768); } else { canvasConfig.canvasSize = new IntVector2(texture.width, texture.height); } CanvasCameraConfig camConfig = new CanvasCameraConfig(); camConfig.camMinSize = 10; camConfig.screenPixelRect = camRect; canvas.initialize(canvasConfig, camConfig, texture); testDrawing(); oldWidth = Screen.width; oldHeight = Screen.height; }
void prebuildCanvasCamConfig() { canvasCameraConfig = new CanvasCameraConfig(); canvasCameraConfig.bgColor = canvasCamBGColor; canvasCameraConfig.camMinSize = canvasCamMinSize; canvasCameraConfig.cameraDepth = canvasCamDepth; }
public void updateCameraConfig(CanvasCameraConfig camConfig) { camera.backgroundColor = camConfig.bgColor; camera.depth = camConfig.cameraDepth; minSize = camConfig.camMinSize; camera.backgroundColor = camConfig.bgColor; camera.depth = camConfig.cameraDepth; updateCameraParameters(camConfig.screenPixelRect, canvasSize); }
public CanvasCamera(CanvasCameraConfig camConfig, IntVector2 canvasSize, GameObject parent) { camRelativePosition = new CanvasCameraRelativePosition(); go = new GameObject("canvas camera"); go.transform.parent = parent.transform; go.transform.position = Vector3.zero; camera = go.AddComponent<Camera>(); camera.orthographic = true; this.canvasSize = canvasSize.toVector2(); updateCameraConfig(camConfig); updateCameraParameters(camConfig.screenPixelRect, canvasSize); }
public CanvasCamera(CanvasCameraConfig camConfig, IntVector2 canvasSize, GameObject parent) { camRelativePosition = new CanvasCameraRelativePosition(); go = new GameObject("canvas camera"); go.transform.parent = parent.transform; go.transform.position = Vector3.zero; camera = go.AddComponent <Camera>(); camera.orthographic = true; this.canvasSize = canvasSize.toVector2(); updateCameraConfig(camConfig); updateCameraParameters(camConfig.screenPixelRect, canvasSize); }
public void initialize(CanvasConfig config, CanvasCameraConfig canvasCameraConfig, Texture2D texture = null) { canvasBuffer = new CanvasBuffer(config.canvasSize, config.bufferSize); this.config = config; canvasCamera = new CanvasCamera(canvasCameraConfig, config.canvasSize, gameObject); backLayer = new CanvasLayer(config.canvasSize, 100, config.layersShader, canvasCamera); frontLayer = new CanvasLayer(config.canvasSize, 20, config.layersShader, canvasCamera); radialLayer = new CanvasRadialLayer(config.canvasSize, 25, config.radialFillShader, config.radialFillTexture, canvasCamera); canvasCollider = CanvasCollider.createCanvasCollider(config.canvasSize, 10, gameObject, canvasCamera); setNewPicture(texture); initialized = true; handleInnerEvents(); }
void Awake() { canvas = gameObject.GetComponent<CanvasController>(); Rect camRect = new Rect(screenOffset.left, screenOffset.bottom, Screen.width - screenOffset.horizontal, Screen.height - screenOffset.vertical); canvasConfig = canvas.config; if (texture == null) canvasConfig.canvasSize = new IntVector2(1024,768); else canvasConfig.canvasSize = new IntVector2(texture.width, texture.height); CanvasCameraConfig camConfig = new CanvasCameraConfig(); camConfig.camMinSize = 10; camConfig.screenPixelRect = camRect; canvas.initialize(canvasConfig, camConfig, texture); testDrawing(); oldWidth = Screen.width; oldHeight = Screen.height; }
public void updateCameraConfig(CanvasCameraConfig canvasCameraConfig) { canvasCamera.updateCameraConfig(canvasCameraConfig); }
void prebuildCanvasCamConfig() { canvasCameraConfig = new CanvasCameraConfig(); canvasCameraConfig.bgColor = canvasCamBGColor; canvasCameraConfig.camMinSize = canvasCamMinSize; canvasCameraConfig.cameraDepth = canvasCamDepth; }
public void updateCameraConfig(CanvasCameraConfig canvasCameraConfig) { canvasCamera.updateCameraConfig(canvasCameraConfig); }
public void initialize(CanvasConfig config, CanvasCameraConfig canvasCameraConfig, Texture2D texture=null) { canvasBuffer = new CanvasBuffer(config.canvasSize, config.bufferSize); this.config = config; canvasCamera = new CanvasCamera(canvasCameraConfig, config.canvasSize, gameObject); backLayer = new CanvasLayer(config.canvasSize, 100, config.layersShader, canvasCamera); frontLayer = new CanvasLayer(config.canvasSize, 20, config.layersShader, canvasCamera); radialLayer = new CanvasRadialLayer(config.canvasSize, 25, config.radialFillShader, config.radialFillTexture, canvasCamera); canvasCollider = CanvasCollider.createCanvasCollider (config.canvasSize, 10, gameObject, canvasCamera); setNewPicture(texture); initialized = true; handleInnerEvents(); }
public void updateCameraConfig(CanvasCameraConfig camConfig) { camera.backgroundColor = camConfig.bgColor; camera.depth = camConfig.cameraDepth; minSize = camConfig.camMinSize; camera.backgroundColor = camConfig.bgColor; camera.depth = camConfig.cameraDepth; updateCameraParameters(camConfig.screenPixelRect, canvasSize); }