コード例 #1
0
        //====================================
        //  Animation Picture Panel ~ MouseClick
        //====================================
        private void AnimationPicture_UVCoords_Panel_MouseClick(object sender, MouseEventArgs e)
        {
            int iTotalSpriteColsInImage = 5;
            int iTotalSpriteRowsInImage = 0;

            for (int i = 0; i < GetImageFromList(GetImageNameByState()).Height; i += 192)
            {
                iTotalSpriteRowsInImage += 1;
            }



            float BlitX = ((float)((int)(((float)e.X / (float)AnimationPicture_UVCoords_Panel.Width) * 10)) / 10);
            float BlitY = ((float)((int)(((float)e.Y / (float)AnimationPicture_UVCoords_Panel.Height) * 10)) / 10);

            for (int i = iTotalSpriteColsInImage; i != -1; i--)
            {
                float BlitVal = (float)i / (float)iTotalSpriteColsInImage;
                if (BlitX >= BlitVal)
                {
                    BlitX = BlitVal;
                    break;
                }
            }
            for (int i = iTotalSpriteRowsInImage; i != -1; i--)
            {
                float BlitVal = (float)i / (float)iTotalSpriteRowsInImage;
                if (BlitY >= BlitVal)
                {
                    BlitY = BlitVal;
                    break;
                }
            }

            m_AnimationPicture_UVCoords_Panel_Rect.X      = (int)(BlitX * AnimationPicture_UVCoords_Panel.Width);
            m_AnimationPicture_UVCoords_Panel_Rect.Y      = (int)(BlitY * AnimationPicture_UVCoords_Panel.Height);
            m_AnimationPicture_UVCoords_Panel_Rect.Width  = (int)((1.0 / iTotalSpriteColsInImage) * AnimationPicture_UVCoords_Panel.Width);
            m_AnimationPicture_UVCoords_Panel_Rect.Height = (int)((1.0 / iTotalSpriteRowsInImage) * AnimationPicture_UVCoords_Panel.Height);
            AnimationPicture_UVCoords_Panel.Invalidate();
        }
コード例 #2
0
 private void Heal3_Button_Click(object sender, EventArgs e)
 {
     m_iAnimationButtonStatePlaceholder = (uint)AnimationButtonState.Heal3AnimationButton;
     AnimationPicture_UVCoords_Panel.Invalidate();
 }