当前位置: 首页>>代码示例>>C#>>正文


C# Graphics.RenderWindow类代码示例

本文整理汇总了C#中SFML.Graphics.RenderWindow的典型用法代码示例。如果您正苦于以下问题:C# RenderWindow类的具体用法?C# RenderWindow怎么用?C# RenderWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RenderWindow类属于SFML.Graphics命名空间,在下文中一共展示了RenderWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GameManager

        public GameManager(RenderWindow window, Display startingDisplay)
        {
            this.window = window;

            ActiveDisplay = startingDisplay;
            tex = new RenderTexture(window.Size.X, window.Size.Y);
        }
开发者ID:Sprunth,项目名称:Planetary-Explorers,代码行数:7,代码来源:GameManager.cs

示例2: Client

        public Client(RenderWindow window, ImageManager imageManager)
            : base(window, imageManager)
        {
            this.window = window;
            world = new RenderImage(800, 600);

            inputManager = new InputManager(this);

            ticker = new Ticker();

            window.ShowMouseCursor (false);
            window.SetFramerateLimit (60);

            NetPeerConfiguration netConfiguration = new NetPeerConfiguration("2dThing");
            client = new NetClient(netConfiguration);

            uMsgBuffer = new UserMessageBuffer();
            otherClients = new Dictionary<int, NetworkClient>();
            chat = new Chat(this);

            LoadRessources();

            blockTypeDisplay = new Cube(blockType, imageManager);
            blockTypeDisplay.Position = new Vector2f(window.Width - 2*Cube.WIDTH, window.Height - 2* Cube.HEIGHT);
            layerDisplay = new LayerDisplay(imageManager);
            layerDisplay.Position = blockTypeDisplay.Position - new Vector2f(0, 50);

            mouse = new Sprite (imageManager.GetImage("mouse"));
        }
开发者ID:CyrilPaulus,项目名称:2dThing,代码行数:29,代码来源:Client.cs

示例3: Context

 public Context(RenderWindow window, ResourceHolder<Texture, ResourceID> textures, ResourceHolder<Font, FontID> fonts, Player player) 
 {
     this.window = window;
     this.textures = textures;
     this.fonts = fonts;
     this.player = player;
 }
开发者ID:pixeltasim,项目名称:SFML.NET_Gamedev,代码行数:7,代码来源:State.cs

示例4: CharacterCreationFace

 public CharacterCreationFace(RenderWindow rw, int id, int x, int y)
 {
     _screen = rw;
     ID = id;
     X = x;
     Y = y;
 }
开发者ID:ComposerCookie,项目名称:WanderingSoul,代码行数:7,代码来源:CharacterCreationFace.cs

示例5: PickWorldDeleteButton

 public PickWorldDeleteButton(RenderWindow rw, int id, int x, int y)
 {
     _screen = rw;
     ID = id;
     X = x;
     Y = y;
 }
开发者ID:ComposerCookie,项目名称:WanderingSoul,代码行数:7,代码来源:PickWorldDeleteButton.cs

示例6: MainMenuState

 public MainMenuState(RenderWindow rw)
 {
     GameGUI = new List<GUI>();
     _screen = rw;
     GameGUI.Add(new MainMenuGUI(_screen, 0));
     CurrentGUI = 0;
 }
开发者ID:ComposerCookie,项目名称:WanderingSoul,代码行数:7,代码来源:MainMenuState+(Jacqueline+Tran's+conflicted+copy+2014-10-27).cs

示例7: PickPartyNewParty

 public PickPartyNewParty(RenderWindow rw, int id, int x, int y)
 {
     _screen = rw;
     ID = id;
     X = x;
     Y = y;
 }
开发者ID:ComposerCookie,项目名称:WanderingSoul,代码行数:7,代码来源:PickPartyNewParty.cs

示例8: Draw

 public void Draw(RenderWindow rw)
 {
     for (int i = Animating.Count - 1; i >= 0; i--)
     {
         Animating[i].Draw(rw);
     }
 }
开发者ID:ComposerCookie,项目名称:WanderingSoul,代码行数:7,代码来源:AnimationManager.cs

示例9: NewPartyNewCharacter

 public NewPartyNewCharacter(RenderWindow rw, int id, int x, int y)
 {
     _screen = rw;
     ID = id;
     X = x;
     Y = y;
 }
开发者ID:ComposerCookie,项目名称:WanderingSoul,代码行数:7,代码来源:NewPartyNewCharacter.cs

示例10: RightClickGUI

        public RightClickGUI(RenderWindow rw, int x, int y, int corX, int corY)
        {
            MyButton = new List<GUIButton>();
            _screen = rw;
            ID = -1;
            CurrentButton = 0;
            X = x;
            Y = y;
            Visibility = true;

            MyButton.Add(new RightClickExamineButton(rw, 37, X, Y + MyButton.Count * 20, corX + Logic.CurrentParty.MainParty.MyParty[0].CurMap.MinX, corY + Logic.CurrentParty.MainParty.MyParty[0].CurMap.MinY));

            if (Logic.CurrentParty.MainParty.MyParty[0].CurMap.SpawnedSpawnableLocation[corY + Logic.CurrentParty.MainParty.MyParty[0].CurMap.MinY][corX + Logic.CurrentParty.MainParty.MyParty[0].CurMap.MinX] > -1)
            {
                int i = Logic.CurrentParty.MainParty.MyParty[0].CurMap.SpawnedSpawnableLocation[corY + Logic.CurrentParty.MainParty.MyParty[0].CurMap.MinY][corX + Logic.CurrentParty.MainParty.MyParty[0].CurMap.MinX];
                if (Logic.CurrentParty.MainParty.MyParty[0].CurMap.SpawnedSpawnable[i] is SpawnBuildable)
                {
                    if (Logic.CurrentParty.MainParty.MyParty[0].CurMap.SpawnedSpawnable[i] is SpawnBuildable)
                    {
                        MyButton.Add(new RightClickLitFireButton(rw, 37, X, Y + MyButton.Count * 20, corX + Logic.CurrentParty.MainParty.MyParty[0].CurMap.MinX, corY + Logic.CurrentParty.MainParty.MyParty[0].CurMap.MinY));
                    }
                }
                else if (Logic.CurrentParty.MainParty.MyParty[0].CurMap.SpawnedSpawnable[i] is SpawnResource)
                {
                    MyButton.Add(new RightClickWalkHarvest(rw, 37, X, Y + MyButton.Count * 20, corX + Logic.CurrentParty.MainParty.MyParty[0].CurMap.MinX, corY + Logic.CurrentParty.MainParty.MyParty[0].CurMap.MinY));
                }
            }
            if (Logic.CurrentParty.MainParty.MyParty[0].CurMap.SpawnedLivingThing[corY + Logic.CurrentParty.MainParty.MyParty[0].CurMap.MinY][corX + Logic.CurrentParty.MainParty.MyParty[0].CurMap.MinX].Count > 0)
            {
                MyButton.Add(new RightClickWalkAttack(rw, 37, X, Y + MyButton.Count * 20, corX + Logic.CurrentParty.MainParty.MyParty[0].CurMap.MinX, corY + Logic.CurrentParty.MainParty.MyParty[0].CurMap.MinY));
            }

            MyButton.Add(new RightClickWalk(rw, 37, X, Y + MyButton.Count * 20, corX + Logic.CurrentParty.MainParty.MyParty[0].CurMap.MinX, corY + Logic.CurrentParty.MainParty.MyParty[0].CurMap.MinY));
            MyButton.Add(new RightClickPickButton(rw, 37, X, Y + MyButton.Count * 20, corX + Logic.CurrentParty.MainParty.MyParty[0].CurMap.MinX, corY + Logic.CurrentParty.MainParty.MyParty[0].CurMap.MinY));
        }
开发者ID:ComposerCookie,项目名称:WanderingSoul,代码行数:35,代码来源:RightClickGUI.cs

示例11: MainTitleScreen

        public MainTitleScreen(RenderWindow window)
            : base(window)
        {
            Type = ScreenType.MainTitleScreen;

            base.Init();
               // Gui.AddGameWidget(imb);

            initMenu();

            StraightLineVariableData slvd = new StraightLineVariableData(200F, 100 * 4);
               // slvd.AddKeyData(.25F, 100F);
            slvd.AddKeyData(.5F, 300F);
               // slvd.AddKeyData(.75F, 100F);
            slvd.ComputeData();

            img = new Image(800, 600, new Color(0, 0, 0, 0));
            for (int i = 0; i < slvd.GetCount(); ++i)
            {
               // Log.Cl(slvd.GetData(i));
                img.SetPixel((uint)(100 + i / 4), (uint)slvd.GetData(i), Color.Red);
               // img.SetPixel((uint)(100 + i / 4), (uint)slvd.GetData(i) + 4, Color.Blue);
            }

            tex = new SFML.Graphics.Texture(img);
            spre = new Sprite(tex);

            imb.AddMessage("hoy hoy !");
            imb.OnStopping += new MessageBox.EventHandler(imb_OnStopping);
        }
开发者ID:eickegao,项目名称:Blazera,代码行数:30,代码来源:MainTitleScreen.cs

示例12: Run

        public void Run()
        {
            window = new RenderWindow(new VideoMode(800, 480), "sfml-ui Examples", Styles.Default);
            window.Closed += window_OnCloseRequest;
            window.Resized += window_Resized;

            uimanager = new UISceneManager();
            uimanager.Init(window);

            scene1 = new Scene(ScrollInputs.None);
            scene1.Size = new Vector2f(window.Size.X, window.Size.Y);
            scene1.AddComponent(new TextControl(new Font("font.ttf"), 50) { Size = new Vector2f(800, 100), Color = Color.White, Text = "Hello World", TextAlignment = Alignment.MiddleCenter, Anchor = AnchorPoints.Left | AnchorPoints.Right | AnchorPoints.Top, BackgroundColor = Colors.SteelBlue });
            scene1.AddComponent(new TextControl(new Font("font.ttf"), 16) { Size = new Vector2f(600, 100), Position = new Vector2f(100, 150), Color = Color.Black, Text = "This is an example of sfml-ui, an ui library for SFML.Net", TextAlignment = Alignment.MiddleCenter, Anchor = AnchorPoints.Left | AnchorPoints.Right | AnchorPoints.Top });
            scene1.AddComponent(new PictureControl("example-100.png") { Size = new Vector2f(100, 100), Position = new Vector2f(0, 0), Anchor = AnchorPoints.Left | AnchorPoints.Top });
            scene1.AddComponent(new ButtonControl(new Font("font.ttf"), 16, "button.png", "button_hover.png", "button_pressed.png") { Size = new Vector2f(150, 49), Position = new Vector2f(50, 250), Anchor = AnchorPoints.Left | AnchorPoints.Top, Text = "Press Me :)" });

            uimanager.CurrentScene = scene1;

            while (window.IsOpen())
            {
                window.DispatchEvents();
                window.Clear(Colors.WhiteSmoke);

                uimanager.Render(window);

                window.Display();
            }
        }
开发者ID:Scellow,项目名称:sfml-ui,代码行数:28,代码来源:Example.cs

示例13: Init

        public static void Init()
        {
            ContextSettings settings = new ContextSettings (32, 8, 4, 3, 3);
              Styles windowStyle = Styles.Close;

              if (FULLSCREEN) {
            windowStyle = Styles.Fullscreen;
            Game.Width = FULLSCREEN_WIDTH;
            Game.Height = FULLSCREEN_HEIGHT;
            Game.CameraWidth = FULLSCREEN_WIDTH;
            Game.CameraHeight = FULLSCREEN_HEIGHT;
              }

              Context = new RenderWindow (new VideoMode ((uint)Game.Width, (uint)Game.Height), WindowTitleText, windowStyle, settings);

              Context.Closed += OnClose;
              Context.KeyPressed += KeyPressed;
              Context.KeyReleased += KeyReleased;
              Context.SetKeyRepeatEnabled (true);

              Rand = new Random ();
              EventMgr = new EventManager ();
              World = new GameWorld ();

              Camera = new View ();
              Camera.Center = new Vector2f (CameraWidth / 2, CameraHeight / 2);
              Camera.Size = new Vector2f (CameraWidth, CameraHeight); // Half Size
              Context.SetView (Camera);
        }
开发者ID:colincapurso,项目名称:GlobalGameJam2013,代码行数:29,代码来源:Game.cs

示例14: MainMenu

        public MainMenu(RenderWindow window, ImageManager imageManager, Client client, Server server)
            : base(window, imageManager)
        {
            imageManager = new ImageManager();
            p = new Player(null, imageManager);
            mouse = new Sprite(imageManager.GetImage("mouse"));
            pImage = new RenderImage(window.Width, window.Height);
            pImage.DefaultView.Zoom(0.08F);
            pImage.DefaultView.Center = p.Center + new Vector2f(0, -30);
            pImage.SetView(pImage.DefaultView);

            this.window = window;
            this.client = client;
            this.server = server;
            items = new MenuItem[nbrItem];
            items[0] = new MenuItem("Local Game", new Vector2f(0, 100), StartLocal);
            items[1] = new MenuItem("Connect", new Vector2f(0, 130), Connect);
            items[2] = new MenuItem("Options", new Vector2f(0, 160), Option);
            items[3] = new MenuItem("Load map", new Vector2f(0, 190), LoadMap);
            items[4] = new MenuItem("Save map", new Vector2f(0, 220), SaveMap);
            items[5] = new MenuItem("Exit", new Vector2f(0, 280), Exit);

            foreach (MenuItem i in items)
                i.CenterX((int)window.Width);
        }
开发者ID:CyrilPaulus,项目名称:2dThing,代码行数:25,代码来源:MainMenu.cs

示例15: PickWorldNewWorld

 public PickWorldNewWorld(RenderWindow rw, int id, int x, int y)
 {
     _screen = rw;
     ID = id;
     X = x;
     Y = y;
 }
开发者ID:ComposerCookie,项目名称:WanderingSoul,代码行数:7,代码来源:PickWorldNewWorld.cs


注:本文中的SFML.Graphics.RenderWindow类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。