画像
画像ファイルを読み込んで表示はできる。
文字も表示できる。
でも線が引けない…
線はもう3Dになるのかなと色々見ていると
http://www.saturn.dti.ne.jp/~npaka/xna/xna30/GraphicsEx/index.html
//ラインの描画 public void DrawLine(float x0, float y0, float x1, float y1) { GraphicsDeviceManager gdm = graphics; Color color = Color.Black; float cw=gdm.PreferredBackBufferWidth/2; float ch=gdm.PreferredBackBufferHeight/2; BasicEffect effect = new BasicEffect(gdm.GraphicsDevice,null); VertexDeclaration vd = new VertexDeclaration(gdm.GraphicsDevice,VertexPositionColor.VertexElements); effect.Begin(); gdm.GraphicsDevice.VertexDeclaration=vd; VertexPositionColor[] v=new VertexPositionColor[2]; v[0]=new VertexPositionColor(new Vector3(-1f+x0/cw,1f-y0/ch,0),color); v[1]=new VertexPositionColor(new Vector3(-1f+x1/cw,1f-y1/ch,0),color); foreach (EffectPass pass in effect.CurrentTechnique.Passes) { pass.Begin(); gdm.GraphicsDevice.DrawUserPrimitives<VertexPositionColor>( PrimitiveType.LineList,v,0,1); pass.End(); } effect.End(); }
つまり GraphicsDeviceManager から GraphicsDevice を取得してそこに対して色々やればいいのか
携帯とかと変わらないなぁ、というか参考にしたのも携帯しらべたときに参考にしてたサイトだしなぁ