New Post: BeforeDraw event
Thanks that did it and been able to trigger the event, here the exact syntax :AddHandler Map.Layers(1).BeforeDraw, AddressOf OnBeforeLayerDraw Is there some example somewhere of player drawing with the...
View ArticleNew Post: BeforeDraw event
Check my response to this thread. It details how to convert your player's world coordinates to viewport coordinates. For further info, you probably need to look up some platform game dev tutorials.
View ArticleNew Post: Error using xTile with a state manager
We all have our derp moments :) Glad you solved it!
View ArticleNew Post: BeforeDraw event
Sorry for the delay to get back with the answer on the layer part, What im trying to do is to draw my player on the second layer of the map so that he can walk behind stuff on third one, To make that...
View ArticleNew Post: BeforeDraw event
You need to make sure that you draw your sprites within BeforeDraw using either of the SpriteBatch instances provided by XnaDisplayDevice. These are accessible as properties SpriteBatchAlpha and...
View ArticleNew Post: Tutorial Project's Window Size
I can't seem to figure out how to change the screen size. The tutorial images seem to be able to display the entire map screen, but when I compile and run it, I only get that much. I checked the...
View ArticleNew Post: Tutorial Project's Window Size
Can you post the code that set's the device manager's preferred back buffer width and height, and also the code that sets the viewport dimensions?
View ArticleNew Post: Tutorial Project's Window Size
The code given in the tutorial on this site only explicitly sets the viewport's dimensions, which only affects what's displayed in the window, not the window itself. Changing that around has no affect...
View ArticleNew Post: Tutorial Project's Window Size
You can set the window size as per the code below (taken from the demo code in the Source Code section): public DemoGame() { m_graphicsDeviceManager = new GraphicsDeviceManager(this); #if XBOX...
View ArticleNew Post: Tutorial Project's Window Size
Thank you, that helped. I thought I had already checked the properties of that myself, but I guess I didn't well enough. Thanks again. I'm just a beginner overlooking something that I should've been...
View ArticleNew Post: How do I find tiles intersected by a bounding box?
How would I detect the tiles that a bounding box intersects properly? Obviously I could loop through every tile and check the display rectangle for overlap but there must be a better way.
View ArticleNew Post: How do I find tiles intersected by a bounding box?
There is. If you take your top-left and bottom-right bounding box coordinates and divide them by the tile width and height (taking the integer part), you will get an extent of tiles (top-left,...
View ArticleNew Post: How do I find tiles intersected by a bounding box?
Thanks for the help! I've been implementing a collision model with some guidance from here, and this helps a lot.
View ArticleNew Post: Rectangle is an ambiguous reference error
I'm also getting this error and despite above answer can't seem to implement correctly. I'm a complete noob so any help would be massively appreciated. My animation works perfectly before I implement...
View ArticleNew Post: Rectangle is an ambiguous reference error
xTile defines a type called Rectangle which conflicts with a Rectangle type defined in XNA. If you import both the namespaces Microsoft.Xna.Framework and xTile.Dimensions at the top of your code files...
View ArticleNew Post: DrawNormal is ignoring the offset.
Hi everyone, Im trying to take a piece of my map and render it to a designed position in the window. Im doing this at layer level using the Layer.Draw method:public void Draw(IDisplayDevice...
View ArticleNew Post: DrawNormal is ignoring the offset.
You're right, and I'm quite surprised this has gone unnoticed for such a long time, or at least since the implementation of wrapAround. I'll look into it.. seems like I'm due for a release anyway :)
View Article