예제 #1
0
 protected GUCVisual(int x, int y, int w, int h, bool virtuals, GUCVisual p)
 {
     parent = p;
     if (virtuals)
     {
         vpos  = new ViewPoint(x, y);
         vsize = new ViewPoint(w, h);
     }
     else
     {
         vpos  = PixelToVirtual(x, y);
         vsize = PixelToVirtual(w, h);
     }
     thisView = zCView.Create(vpos.X, vpos.Y, vpos.X + vsize.X, vpos.Y + vsize.Y);
     shown    = false;
 }
예제 #2
0
        public GUCVisualText(string text, int x, int y, GUCVisual parent, bool virtuals)
        {
            this.parent = parent;
            if (virtuals)
            {
                vpos = new ViewPoint(x, y);
            }
            else
            {
                vpos = GUCVisual.PixelToVirtual(x, y);
            }
            vpos = new ViewPoint(vpos.X * 0x2000 / parent.VSize.X, vpos.Y * 0x2000 / parent.VSize.Y);
            using (zString z = zString.Create(text))
                zviewText = parent.zView.CreateText(vpos.X, vpos.Y, z);

            shown = true;
        }
예제 #3
0
        public void SetPos(ViewPoint newPos, bool virtuals = false)
        {
            if (!virtuals)
            {
                newPos = PixelToVirtual(newPos);
            }

            int diffX = newPos.X - vpos.X;
            int diffY = newPos.Y - vpos.Y;

            vpos = newPos;
            thisView.SetPos(vpos.X, vpos.Y);

            //update children
            foreach (GUCVisual vis in children)
            {
                vis.SetPos(vis.vpos.X + diffX, vis.vpos.Y + diffY, true);
            }
        }
예제 #4
0
        public static ViewPoint GetScreenSize()
        {
            var screen = Gothic.View.zCView.GetScreen();

            var ret = new ViewPoint(screen.pSizeX, screen.pSizeY);

            if (ret.X > 0 && ret.Y > 0)
            {
                iniRes = false;
            }
            else
            {
                var sec = Gothic.zCOption.GetSectionByName("VIDEO");
                ret.X = Convert.ToInt32(sec.GetEntryByName("zVidResFullscreenX").VarValue.ToString());
                ret.Y = Convert.ToInt32(sec.GetEntryByName("zVidResFullscreenY").VarValue.ToString());

                if (!iniRes)
                {
                    Log.Logger.LogWarning("Couldn't find real resolution, using Gothic.ini resolution: " + ret.X + "x" + ret.Y);
                }
                iniRes = true;
            }
            return(ret);
        }
예제 #5
0
 public void SetSize(ViewPoint size, bool virtuals = false)
 {
     vsize = virtuals ? size : PixelToVirtual(size);
     thisView.SetSize(vsize.X, vsize.Y);
 }
예제 #6
0
        public static ViewPoint PixelToVirtual(ViewPoint point)
        {
            var res = GetScreenSize();

            return(new ViewPoint(point.X * 0x2000 / res.X, point.Y * 0x2000 / res.Y));
        }