473,473 Members | 2,277 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How do I create window height and window width in visual c# 2008?

1 New Member
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace SimplePlayer1
{

class Player
{
Vector2 position;
Texture2D shipSprite;
Vector2 spriteOrigin;
int windowWidth, windowHeight;

public Player(GraphicsDevice devic, Vector2 position, Texture2D sprite)
{
//The position that is passed in is now set to the position above
this.position = position;

//Set the Texture2D
shipSprite = sprite;

//Setup origin
spriteOrigin.X = (float)shipSprite.Width / 2.0f;
spriteOrigin.Y = (float)shipSprite.Height / 2.0f;

windowHeight = device.Viewport.Height;
windowWidth = device.Viewport.Width;

}
}
}

When I type in the code it comes up with an error that says the name device does not exist in the current context.

Please help
Dec 30 '10 #1
1 3087
GaryTexmo
1,501 Recognized Expert Top Contributor
public Player(GraphicsDevice devic, Vector2 position, Texture2D sprite)
Looks like you've got a typo there :)
Dec 30 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Jack Black | last post by:
Using Mozilla 1.4... I need to get the Height and Width of an object (in this case, a parent DIV) for the purpose of creating a textbox of max width and height in the container. Since...
3
by: Chris Beall | last post by:
OK, I know that for many browsers, window height and width can be obtained from: window.outerHeight and window.innerHeight window.outerWidth and window.innerWidth And I know that if those are...
5
by: Dave Hammond | last post by:
You'd think this would be a basic part of the window object (and perhaps it is and I'm just being dense), but I can't find any reference in the IE window object documentation to a property which...
2
by: Van der Weij | last post by:
Hi, I want to preload some images for a webpage _and_ determing their width and height. The problem is that the scripts continue while the images are loaded in the background, while I need the...
4
by: Dotcom | last post by:
I have an ASP.NET application that is mysteriously acquiring height and width attributes on a particular IMG element on multiple pages. This is not being caused by someone editing or uploading new...
11
by: Dave | last post by:
For some reason, the below lines only work on select machines. All machines are running IE6. IE SP's and OS's vary. When it doesn't work, default.aspx (the page that this code is in) opens and...
1
by: RC | last post by:
I have tbody { height: 30em; width: 80em; overflow: hidden; } For FF (Firefox) and NS (Netscape) the height is working fine, no vertical scrolling bar on window. But the width is not effect...
1
by: soms2m | last post by:
HELLO ALL, I want to fill the parent window height with respect to the sub window height which is loading using ajax (mootools). For example if the parent window height is normal and the loading...
1
by: Mike P | last post by:
I am adding a hyperlink to a table and I want the hyperlink to open a window with height and width I can set myself when it is clicked : HyperLink hypGetExtractSQL = new HyperLink(); ...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.