コード例 #1
0
ファイル: timeless.cs プロジェクト: zeromus/carotengine
        protected override void Draw(GameTime gameTime)
        {
            Blitter b = new Blitter(screen);
            bCurr = b;
            b.Clear(Color.Gray);

            //do it with supersecret
            SuperSecretThingy(scrollofs/16, systemtime/2, 0, bg, SuperSecretBuffer);
            b.Blit(SuperSecretBuffer);

            //do it plain for debugging
            //WrapBlit(b, bg, 0, 0);

            //b.ScaleBlit(bobgreen, 0, 0, 100, 100);

            RenderSprites(b);
            app.Window.Title = systemtime.ToString();
            //b.ScaleBlit(spherepurple, 0, 0, 100,100); //test
        }
コード例 #2
0
ファイル: bgr4.cs プロジェクト: zeromus/carotengine
        void InitializeBGR4(int f)
        {
            Image myimg = null;

            Blitter b = new Blitter(bg2);
            b.Clear(Color.Black);

            switch (f)
            {
                case 0: myimg = facered; break;
                case 1: myimg = faceblue; break;
                case 2: myimg = facegreen; break;
                case 3: myimg = sphereblue; break;
                case 4: myimg = spheregreen; break;
                case 5: myimg = sphereorange; break;
                case 6: myimg = spherepurple; break;
            }

            myimg = spherepurple;

            for (int i = 0; i < 30; i++)
            {
                f = Random(0, 2);
                int dw = -1, dh = -1;
                switch (f)
                {
                    case 0: dw = 64; dh = 64; break;
                    case 1: dw = 32; dh = 32; break;
                    case 2: dw = 16; dh = 16; break;
                }
                int x=Random(0, 255), y=Random(0, 255);
                ScaleWrapBlit(x,y, myimg, dw, dh, bg2);
            }
            InitializeBGR3();
            bg2.Cache();
        }
コード例 #3
0
ファイル: system.cs プロジェクト: zeromus/carotengine
 //void ScaleTo(int w, int h, int srcimg, int destimg)
 void StaticInitializers()
 {
     bg = NewImage(256, 256);
     Blitter b = new Blitter(bg);
     b.Clear(Color.Black);
     bg2 = NewImage(256, 256);
     bg3 = NewImage(256, 256);
     LoadResources();
 }
コード例 #4
0
ファイル: V3Sysfont.cs プロジェクト: Gayo/Gayo-CAROT
        void init(int scale, Color color, bool dropDown, bool dropRight, Color dropShadowColor)
        {
            int numchars = smal_tbl.Length;
            _ge = GameEngine.Game;
            _scale = scale;
            _color = color;
            //images = new Image[numchars];
            rects = new Rectangle[numchars];

            //figure out the character layout
            int px=0, py=0;
            int ih = 7 * scale;
            if(dropDown) ih++;
            int maxw = 0;
            for(int i = 0; i < numchars; i++) {
                int cw = smal_tbl[i][0];
                int iw = cw * scale;
                if(dropRight) iw++;

                if(px + iw > 2048) {
                    py += ih;
                    px = 0;
                }

                Rectangle r = new Rectangle(px, py, iw, ih);
                rects[i] = r;
                px += iw;
                maxw = Math.Max(maxw,px);
            }

            //now generate the image
            image = _ge.NewImage(maxw, py+ih);
            Blitter b = new Blitter(image);
            b.Clear(Color.Transparent);
            for(int i = 0;i < numchars;i++) {

                Rectangle rect = rects[i];

                //draw the dropshadows
                if(dropDown) {
                    rect.Y++;
                    rect.Height--;

                    b.ApplyWindow(rect);
                    print_char(b, i, dropShadowColor);
                    b.PopWindow();

                    rect.Y--;
                }

                if(dropRight) {
                    rect.X++;
                    rect.Width--;

                    b.ApplyWindow(rect);
                    print_char(b, i, dropShadowColor);
                    b.PopWindow();

                    rect.X--;
                }

                if(dropRight && dropDown) {
                    rect.X++;
                    rect.Y++;
                    b.ApplyWindow(rect);
                    print_char(b, i, dropShadowColor);
                    b.PopWindow();
                    rect.X--;
                    rect.Y--;
                }

                //draw the main character:
                b.ApplyWindow(rect);
                print_char(b, i, color);
                b.PopWindow();

            }
            image.Cache();
        }
コード例 #5
0
ファイル: GameController.cs プロジェクト: Gayo/Gayo-CAROT
            public void draw()
            {
                Blitter b = new Blitter(cabedge.screen);
                switch(state) {

                    case State.MainMenu:
                        b.Clear(Color.Black);
                        break;

                    case State.InGame:
                        rpgController.draw(rpgBackbuffer);
                        b.StretchBlit(rpgBackbuffer, 0, 0, 640, 480);
                        uiController.draw();
                        break;

                }
            }