ERLEDIGT
NEIN
NEIN
ANTWORTEN
1
1
ZUGRIFFE
1624
1624
EMPFEHLEN
-
18.01.08 16:20 #1
Bei Kompilieren meines Programmes bekomme ich folgendenen Fehler:
Bei diesem Quellcode:Fehler 1 Die beste Übereinstimmung für die überladene Microsoft.Xna.Framework.Graphics.SpriteBatch.DrawString(Microsoft.Xna.Framework.Graphics.SpriteFont, string, Microsoft.Xna.Framework.Vector2, Microsoft.Xna.Framework.Graphics.Color)-Methode hat einige ungültige Argumente. C:\Dokumente und Einstellungen\root\Eigene Dateien\Visual Studio 2005\Projects\Wehrmacht\Wehrmacht\Game1.cs 70 13 Wehrmacht
Fehler 2 2-Argument: kann nicht von "Microsoft.Xna.Framework.Input.MouseState" in "string" konvertiert werden. C:\Dokumente und Einstellungen\root\Eigene Dateien\Visual Studio 2005\Projects\Wehrmacht\Wehrmacht\Game1.cs 70 38 Wehrmacht
Leider finde ich den Fehler nicht.Code c:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
#region Using Statements using System; using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Storage; #endregion namespace Wehrmacht { public class Game1 : Microsoft.Xna.Framework.Game { GraphicsDeviceManager graphics; ContentManager content; SpriteBatch Sprite; SpriteFont Arial; KeyboardState ksState; MouseState msState; public Game1() { graphics = new GraphicsDeviceManager(this); content = new ContentManager(Services); this.IsMouseVisible = true; } protected override void Initialize() { base.Initialize(); } protected override void LoadGraphicsContent(bool loadAllContent) { if (loadAllContent) { Arial = content.Load<SpriteFont>("Arial"); Sprite = new SpriteBatch(graphics.GraphicsDevice); } } protected override void UnloadGraphicsContent(bool unloadAllContent) { if (unloadAllContent) { content.Unload(); } } protected override void Update(GameTime gameTime) { ksState = Keyboard.GetState(); msState = Mouse.GetState(); if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) this.Exit(); base.Update(gameTime); } protected override void Draw(GameTime gameTime) { graphics.GraphicsDevice.Clear(Color.CornflowerBlue); ksState = Keyboard.GetState(); msState = Mouse.GetState(); Sprite.Begin(); Sprite.DrawString(Arial, msState, new Vector2(20, 20), Color.White); Sprite.End(); base.Draw(gameTime); } } }
Ich möchte immer die aktuelle Mausposition und die aktuelle gedrückte Taste(n) ausgeben.
Ich bin mir nicht sicher ob ich das in die Draw oder Update Funktion reinmachen soll.
.
Danke für Tipps
-
20.01.08 14:40 #2
- Registriert seit
- Apr 2005
- Beiträge
- 120
Hi tobee,
versuch mal in der DrawString-Funktion mbState.ToString(). Im Gegensatz zu Visual Basic ist C# ebenso wie alle anderen C-Sprachen nämlich relativ pingelig was die Typkonvertierung angeht.
Gruß
PhoenixLoe
Ähnliche Themen
-
Substr_Count bei genauer Übereinstimmung (mit _.)
Von Thomas_Jung im Forum PHPAntworten: 1Letzter Beitrag: 12.12.08, 11:33 -
preg_match bei genauer Übereinstimmung die 2te
Von Thomas_Jung im Forum PHPAntworten: 3Letzter Beitrag: 26.11.08, 09:20 -
Substr_Count bei genauer Übereinstimmung
Von Thomas_Jung im Forum PHPAntworten: 4Letzter Beitrag: 25.11.08, 13:32 -
Dateien mit Übereinstimmung aus DB löschen
Von Beezle92 im Forum PHPAntworten: 3Letzter Beitrag: 26.08.08, 12:10 -
password übereinstimmung?
Von moonlight-kknd im Forum Relationale DatenbanksystemeAntworten: 4Letzter Beitrag: 04.04.05, 21:06





Zitieren
Login





