Пример #1
0
    public static void init()
    {
        if (mInitialized)
        {
            return;
        }
        mInitialized = true;

        dialogs = new List <Dialog>();

        shadow = new CSprite();
        //Esta tambien el shadow solo que llena toda la pantalla
        shadow.setImage(Resources.Load <Sprite>("Sprites/dialogShadow/shadow"));
        shadow.setName("Dialog - Background");
        shadow.setSortingLayerName("UI");
        shadow.setXY(0, CGameConstants.SCREEN_HEIGHT / 3 * 2);
        shadow.setWidth(CGameConstants.SCREEN_WIDTH);
        shadow.setVisible(false);

        characterPortrait = new CSprite();
        characterPortrait.setName("Character - Portrait");
        characterPortrait.setSortingLayerName("UI");
        characterPortrait.setXY(shadow.getX() + MARGIN, shadow.getY() + MARGIN);
        characterPortrait.setVisible(false);
        characterPortrait.setSortingOrder(1);

        text = new CText("");
        text.setFontSize(500.0f);
        text.setVisible(false);
        text.setXY(CGameConstants.SCREEN_WIDTH / 4 + MARGIN, shadow.getY() + MARGIN);
        text.setWidth(CGameConstants.SCREEN_WIDTH / 4 * 3 - MARGIN * 2);
    }
Пример #2
0
    public bool optionsClick()
    {
        bool clicked = false;

        if (CMouse.firstPress())
        {
            float button1MinX = optionsBttn.getX() - optionsBttn.getWidth() / 2;
            float button1MaxX = optionsBttn.getX() + optionsBttn.getWidth() / 2;
            float button1MinY = optionsBttn.getY() - optionsBttn.getHeight() / 2;
            float button1MaxY = optionsBttn.getY() + optionsBttn.getHeight() / 2;
            float mouseX      = CMouse.getPos().x;
            float mouseY      = CMouse.getPos().y;
            if (mouseX >= button1MinX && mouseX <= button1MaxX && mouseY >= button1MinY && mouseY <= button1MaxY)
            {
                clicked = true;
            }
        }

        return(clicked);
    }
Пример #3
0
    public bool nextScreenClick()
    {
        bool clicked = false;

        if (CMouse.firstPress())
        {
            float button1MinX = btnNextScreen.getX() - btnNextScreen.getWidth() / 2;
            float button1MaxX = btnNextScreen.getX() + btnNextScreen.getWidth() / 2;
            float button1MinY = btnNextScreen.getY() - btnNextScreen.getHeight() / 2;
            float button1MaxY = btnNextScreen.getY() + btnNextScreen.getHeight() / 2;
            float mouseX      = CMouse.getPos().x;
            float mouseY      = CMouse.getPos().y;
            if (mouseX >= button1MinX && mouseX <= button1MaxX && mouseY >= button1MinY && mouseY <= button1MaxY)
            {
                clicked = true;
            }
        }

        return(clicked);
    }
Пример #4
0
    public bool exitClick()
    {
        bool clicked = false;

        if (CMouse.firstPress())
        {
            float button1MinX = exit.getX();
            float button1MaxX = exit.getX() + exit.getWidth();
            float button1MinY = exit.getY();
            float button1MaxY = exit.getY() + exit.getHeight();
            float mouseX      = CMouse.getPos().x;
            float mouseY      = CMouse.getPos().y;
            if (mouseX >= button1MinX && mouseX <= button1MaxX && mouseY >= button1MinY && mouseY <= button1MaxY)
            {
                clicked = true;
            }
        }

        return(clicked);
    }