Inheritance: BaseSprite
Exemplo n.º 1
0
 public void AddSpeaker()
 {
     if(this.dialoguePosition.multiLabel.speakerPortrait != null)
     {
         this.speakerSprite = this.AddChild("_Speaker");
     }
 }
Exemplo n.º 2
0
 public void AddOk()
 {
     if(this.dialoguePosition.multiLabel.HasOkTexture())
     {
         this.okSprite = this.AddChild("_Ok");
     }
 }
Exemplo n.º 3
0
 public void AddName()
 {
     if(this.dialoguePosition.multiLabel.HasNameTexture())
     {
         this.nameSprite = this.AddChild("_Name");
     }
 }
Exemplo n.º 4
0
 public void AddContent()
 {
     if(this.dialoguePosition.multiLabel.HasContentTexture())
     {
         this.contentSprite = this.AddChild("_Content");
         if(this.dialoguePosition.multiLabel.HasVScrollTexture())
         {
             this.vScrollSprite = this.AddChild("_VScroll");
         }
     }
 }
Exemplo n.º 5
0
 /*
 ============================================================================
 Init functions
 ============================================================================
 */
 public void Show(string name, string text, ChoiceContent[] choices, SpeakerPortrait speakerPortrait, StatusBar[] bar, bool dt)
 {
     this.destroyTextures = dt;
     if(this.skin == null) this.LoadSkins();
     if(this.fadeIn && !this.inDone) this.alpha = 0;
     if(this.sprite == null)
     {
         this.multiLabel.CreateContent(this, name, text, choices, speakerPortrait, bar);
         this.sprite = GameHandler.GUIHandler().AddDPSprite(this);
     }
     else
     {
         this.multiLabel.CreateContent(this, name, text, choices, speakerPortrait, bar);
     }
 }
Exemplo n.º 6
0
    void LateUpdate()
    {
        if(gameObject.name == "_DPSprite")
        {
            Vector2 ratio = GameHandler.GUIHandler().GetScreenRatio();
            if(this.dialoguePosition.multiLabel.newTextures)
            {
                if(this.vScrollSprite == null && this.dialoguePosition.multiLabel.HasVScrollTexture())
                {
                    this.vScrollSprite = this.AddChild("_VScroll");
                }
                else if(this.vScrollSprite != null && !this.dialoguePosition.multiLabel.HasVScrollTexture())
                {
                    GameObject.Destroy(this.vScrollSprite.gameObject);
                }
                this.UpdateTextures();
                this.UpdateGUISize(true, ratio);
            }
            transform.position = new Vector3(
                    -(Screen.width/2)+(this.dialoguePosition.currentPos.x+
                        (this.dialoguePosition.boxBounds.width/2))*ratio.x,
                    0+(this.spriteID/100.0f),
                    -(Screen.height/2)+(this.dialoguePosition.currentPos.y+
                        (this.dialoguePosition.boxBounds.height/2))*ratio.y);
        }
        else if(gameObject.name == "_Content")
        {
            Vector2 ratio = GameHandler.GUIHandler().GetScreenRatio();
            transform.localPosition = new Vector3(0,
                    -0.002f, (this.dialoguePosition.contentBounds.height/2)*ratio.y);
            this.renderer.material.mainTextureOffset = this.dialoguePosition.scrollSize;
        }
        else if(gameObject.name == "_VScroll")
        {
            Vector2 ratio = GameHandler.GUIHandler().GetScreenRatio();
            transform.localPosition = new Vector3((this.dialoguePosition.vScrollBounds.x/2)*ratio.x,
                    -0.003f,
                    (this.dialoguePosition.vScrollTop-this.dialoguePosition.vScrollPixel*
                    (this.dialoguePosition.scrollSize.y-this.dialoguePosition.scrollBoundTop))*ratio.y);
        }
        else if(gameObject.name == "_Name")
        {
            Vector2 ratio = GameHandler.GUIHandler().GetScreenRatio();
            if(this.dialoguePosition.isDragWindow)
            {
                transform.localPosition = new Vector3(0, -0.004f,
                        -((this.dialoguePosition.boxBounds.height-this.renderer.material.mainTexture.height)/2)*ratio.y);

            }
            else
            {
                transform.position = new Vector3(
                        -(Screen.width/2)+(this.dialoguePosition.currentPos.x+
                            this.dialoguePosition.nameOffset.x+
                            (this.dialoguePosition.nameBounds.width/2))*ratio.x,
                        transform.parent.position.y-0.004f,
                        -(Screen.height/2)+(this.dialoguePosition.currentPos.y+
                            this.dialoguePosition.nameOffset.y+
                            (this.dialoguePosition.nameBounds.height/2))*ratio.y);
            }
        }
        else if(gameObject.name == "_Ok")
        {
            Vector2 ratio = GameHandler.GUIHandler().GetScreenRatio();
            transform.localPosition = new Vector3(
                    this.dialoguePosition.okButtonBounds.x*ratio.x,
                    -0.005f,
                    this.dialoguePosition.okButtonBounds.y*ratio.y);
        }
        else if(gameObject.name == "_Speaker")
        {
            Vector2 ratio = GameHandler.GUIHandler().GetScreenRatio();
            if(this.dialoguePosition.multiLabel.speakerPortrait.inBox)
            {
                transform.position = new Vector3(
                    -(Screen.width/2)+(this.dialoguePosition.currentPos.x+
                        this.dialoguePosition.multiLabel.speakerPortrait.position.x+
                        (this.renderer.material.mainTexture.width/2))*ratio.x,
                    transform.parent.position.y-0.001f,
                    -(Screen.height/2)+(this.dialoguePosition.currentPos.y+
                        this.dialoguePosition.multiLabel.speakerPortrait.position.y+
                        (this.renderer.material.mainTexture.height/2))*ratio.y);
            }
            else
            {
                transform.position = new Vector3(
                    -(Screen.width/2)+(this.dialoguePosition.multiLabel.speakerPortrait.position.x+
                        (this.renderer.material.mainTexture.width/2))*ratio.x,
                    transform.parent.position.y+0.001f,
                    -(Screen.height/2)+(this.dialoguePosition.multiLabel.speakerPortrait.position.y+
                        (this.renderer.material.mainTexture.height/2))*ratio.y);
            }
        }
    }