<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>tIDE Discussions Rss Feed</title><link>http://tide.codeplex.com/Thread/List.aspx</link><description>tIDE Discussions Rss Description</description><item><title>New Post: "Begin cannot be called again..." error when using BeforeDraw event</title><link>http://tide.codeplex.com/discussions/443838</link><description>&lt;div style="line-height: normal;"&gt;I'm glad you sorted the problem. As to the stuttering, perhaps the player position calculation is not in synch with the Viewport coordinates? Let me know how that goes and I'll try to help out if I can.&lt;br /&gt;
&lt;/div&gt;</description><author>colinvella</author><pubDate>Fri, 17 May 2013 11:33:16 GMT</pubDate><guid isPermaLink="false">New Post: "Begin cannot be called again..." error when using BeforeDraw event 20130517113316A</guid></item><item><title>New Post: "Begin cannot be called again..." error when using BeforeDraw event</title><link>http://tide.codeplex.com/discussions/443838</link><description>&lt;div style="line-height: normal;"&gt;I had another look as to why it was needed and it turns out it was for assistance with a Zoom functionality with our old tile system. It also prevented having to minus off the camera position when drawing the player sprite.&lt;br /&gt;
&lt;br /&gt;
Like so:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt; spriteBatch.Draw(
                texture, position - camera.Position,
                animations[currentAnimation].CurrentFrameRect,
                Color.White);&lt;/code&gt;&lt;/pre&gt;

It all works now without the transform. However there is a bit of stuttering when walking. I'm just investigating whether this has to do with the drawing between layers.&lt;br /&gt;
&lt;br /&gt;
Thanks for your help!&lt;br /&gt;
&lt;/div&gt;</description><author>jprpg</author><pubDate>Fri, 17 May 2013 05:07:23 GMT</pubDate><guid isPermaLink="false">New Post: "Begin cannot be called again..." error when using BeforeDraw event 20130517050723A</guid></item><item><title>New Post: "Begin cannot be called again..." error when using BeforeDraw event</title><link>http://tide.codeplex.com/discussions/443838</link><description>&lt;div style="line-height: normal;"&gt;I don't know what to suggest until I at least figure out why you need the camera transform. Are you using this to pan around the level or doing more sophisticated effects?&lt;br /&gt;
&lt;/div&gt;</description><author>colinvella</author><pubDate>Thu, 16 May 2013 09:59:47 GMT</pubDate><guid isPermaLink="false">New Post: "Begin cannot be called again..." error when using BeforeDraw event 20130516095947A</guid></item><item><title>New Post: "Begin cannot be called again..." error when using BeforeDraw event</title><link>http://tide.codeplex.com/discussions/443838</link><description>&lt;div style="line-height: normal;"&gt;Hi there,&lt;br /&gt;
&lt;br /&gt;
Im trying to draw my player on the first layer of my map using BeforeDraw like so:&lt;br /&gt;
&lt;br /&gt;
In Initialize():&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;map.Layers[1].BeforeDraw += new xTile.Layers.LayerEventHandler(e_OnBeforeLayerDraw);&lt;/code&gt;&lt;/pre&gt;

My handler &amp;amp; draw class look like this:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;        private void e_OnBeforeLayerDraw(object sender, xTile.Layers.LayerEventArgs  layerEventArgs)
        {
            SpriteBatch spriteBatch = xdd.SpriteBatchAlpha;
            player.Draw(pGameTime, spriteBatch);
        }

         public override void Draw(GameTime gameTime)
        {
            
            //xTile
            //map.Draw(mapDisplayDevice, GameRef.viewport);
            map.Draw(xdd, GameRef.viewport);
            base.Draw(gameTime);
            //world.DrawLevel(gameTime, GameRef.SpriteBatch, player.Camera);
            //player.Draw(gameTime, GameRef.SpriteBatch);
        }&lt;/code&gt;&lt;/pre&gt;

This is my player.Draw()&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {    
            spriteBatch.Begin(
            SpriteSortMode.Deferred,
            BlendState.AlphaBlend,
            SamplerState.PointClamp,
            null,
            null,
            null,
            Camera.Transformation);

            character.Draw(gameTime, spriteBatch);

            spriteBatch.End();
        }&lt;/code&gt;&lt;/pre&gt;

The error appears in player.Draw() on my spriteBatch.Begin (first line). I get a &amp;quot;Begin cannot be called again until End has been successfully called&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
I guess this is because xTile has started a begin somewhere and when the event handler fires off the .end() has not been reached. However, I need a begin() so I can put my Camera.Transformation Matrix in, or else my camera does not function properly.&lt;br /&gt;
&lt;br /&gt;
Is there any way for me to fix this?&lt;br /&gt;
&lt;br /&gt;
Any help is greatly appreciated.&lt;br /&gt;
&lt;/div&gt;</description><author>jprpg</author><pubDate>Thu, 16 May 2013 04:32:15 GMT</pubDate><guid isPermaLink="false">New Post: "Begin cannot be called again..." error when using BeforeDraw event 20130516043215A</guid></item><item><title>New Post: Accessing tile animation data</title><link>http://tide.codeplex.com/discussions/443324</link><description>&lt;div style="line-height: normal;"&gt;Hmm for sure something to think about. I'm going to look into that. :)&lt;br /&gt;
&lt;br /&gt;
/Jakob&lt;br /&gt;
&lt;/div&gt;</description><author>JakobB</author><pubDate>Wed, 15 May 2013 20:50:02 GMT</pubDate><guid isPermaLink="false">New Post: Accessing tile animation data 20130515085002P</guid></item><item><title>New Post: Accessing tile animation data</title><link>https://tide.codeplex.com/discussions/443324</link><description>&lt;div style="line-height: normal;"&gt;Thanks for clarifying. Depending on how much time you have invested in your rendering engine, you might want to write your own implementation for IDisplayDevice. IDisplayDevice is intended to abstract the tile engine from the underlying graphics api. The project's codebase has a spritebatch and a gdi+ implementation you might want to look at.  Obviously you know what's best for your project but I thought this might be a viable option.&lt;br /&gt;
&lt;br /&gt;
Hope that helps&lt;br /&gt;
Colin&lt;br /&gt;
&lt;/div&gt;</description><author>colinvella</author><pubDate>Wed, 15 May 2013 17:14:26 GMT</pubDate><guid isPermaLink="false">New Post: Accessing tile animation data 20130515051426P</guid></item><item><title>New Post: Accessing tile animation data</title><link>http://tide.codeplex.com/discussions/443324</link><description>&lt;div style="line-height: normal;"&gt;It looks like this is exactly what I needed. I'll check it out when I get the chance :)&lt;br /&gt;
&lt;br /&gt;
The reason why I'm doing the rendering myself is that I've already begun writing platformer game using my own rendering engine. I'm using a quad with animated uv coordinates for sprites (such as the player) and use a camera (so it is actually all done in 3d, only the assets are all quads and the camera projection is orthogonal). It appeared difficult to marry this approach with your spritebatch implementation for the level. Further, working in full 3d seems to me to give many benefits for free such as easy camera zooming. I'm unsure how one would go ahead and implement particle effects and screen space effects easily using spritesheet. Primarily, i'm much more comfortable working in full 3d and have little experience with xna spritesheet.&lt;br /&gt;
&lt;br /&gt;
For these reasons, I didn't work alot with your rendering code and can't really comment on the api or performance. From what I did try, I had no issues at all.&lt;br /&gt;
I might reconsider and rewrite my rendering code using xna spritesheet and use it together with your code. &lt;br /&gt;
&lt;br /&gt;
Thanks again for the help and thanks a lot for tIDE, it has really helped me along!&lt;br /&gt;
/Jakob&lt;br /&gt;
&lt;/div&gt;</description><author>JakobB</author><pubDate>Wed, 15 May 2013 15:10:12 GMT</pubDate><guid isPermaLink="false">New Post: Accessing tile animation data 20130515031012P</guid></item><item><title>New Post: Accessing tile animation data</title><link>http://tide.codeplex.com/discussions/443324</link><description>&lt;div style="line-height: normal;"&gt;&lt;strong&gt;Tile&lt;/strong&gt; is actually a an abstract base type so in actual fact you will get either a &lt;strong&gt;StaticTile&lt;/strong&gt; or &lt;strong&gt;AnimatedTile&lt;/strong&gt; instance (both being derived from &lt;strong&gt;Tile&lt;/strong&gt;).&lt;br /&gt;
&lt;br /&gt;
Keep also in mind that &lt;strong&gt;Tiles[x, y]&lt;/strong&gt; can return a &lt;strong&gt;Null&lt;/strong&gt; instance when there is no tile at the given coorodinates, so you will need to check for this.&lt;br /&gt;
&lt;br /&gt;
So basically you have two approaches to get the tile details:&lt;br /&gt;
1) Check the type of the returned &lt;strong&gt;Tile&lt;/strong&gt; (if not null) to determine if it is a &lt;strong&gt;StaticTile&lt;/strong&gt; or &lt;strong&gt;AnimatedTile&lt;/strong&gt;, and downcast the tile accordingly. In the case of a static tile, you can access the corresponding &lt;strong&gt;TileSheet&lt;/strong&gt; and &lt;strong&gt;TileIndex&lt;/strong&gt; properties. In the case of an animated tile, you can access a Frames collection property and determine the current frame yourself. An individual tile frame is actually an instance of &lt;strong&gt;StaticTile&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
2) If you invoke &lt;strong&gt;Map.Update(...)&lt;/strong&gt;, which takes care of the animation timings, you need not downcast the &lt;strong&gt;Tile&lt;/strong&gt; to either of the above classes. You can instead simply get the &lt;strong&gt;TileSheet&lt;/strong&gt; and &lt;strong&gt;TileIndex&lt;/strong&gt; properties from the Tile instance. If the tile is an animated one, it will actually give you the tile sheet and index corresponding to the current animation frame.&lt;br /&gt;
&lt;br /&gt;
I think option (1) is messier (due to the type checking and downcasting) and more complex to implement, whereas option (2) is both cleaner and simpler.&lt;br /&gt;
&lt;br /&gt;
On a related note, is there a reason why you wish to implement the rendering code yourself. Did you experience any performance issues or found the API limiting?&lt;br /&gt;
&lt;/div&gt;</description><author>colinvella</author><pubDate>Wed, 15 May 2013 10:02:04 GMT</pubDate><guid isPermaLink="false">New Post: Accessing tile animation data 20130515100204A</guid></item><item><title>New Post: Accessing tile animation data</title><link>http://tide.codeplex.com/discussions/443324</link><description>&lt;div style="line-height: normal;"&gt;Cool! I've looked through my map (.tide) file with a text editor and can indeed see the xml structure you described.&lt;br /&gt;
&lt;br /&gt;
I guess one way to access the data would be to parse this file and extract the animation data, or perhaps rewrite the custom content importer that you wrote. Am I right though that there's currently no way to access this data through the provided api?&lt;br /&gt;
&lt;br /&gt;
Example psedo code:&lt;br /&gt;
Tile t = tileMap.GetLayer(layerName).Tiles[x, y];&lt;br /&gt;
var animation = t.GetAnimation(); //or something similar?&lt;br /&gt;
&lt;br /&gt;
/Jakob&lt;br /&gt;
&lt;/div&gt;</description><author>JakobB</author><pubDate>Tue, 14 May 2013 19:24:30 GMT</pubDate><guid isPermaLink="false">New Post: Accessing tile animation data 20130514072430P</guid></item><item><title>New Post: Accessing tile animation data</title><link>http://tide.codeplex.com/discussions/443324</link><description>&lt;div style="line-height: normal;"&gt;Animation data is not stored in the form of custom properties, but as an &amp;lt;Animated ... /&amp;gt; tag as in the following example:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;Animated Interval=&amp;quot;100&amp;quot;&amp;gt;
    &amp;lt;Frames&amp;gt;
        &amp;lt;TileSheet Ref=&amp;quot;TileSheet01&amp;quot; /&amp;gt;
        &amp;lt;Static Index=&amp;quot;56&amp;quot; BlendMode=&amp;quot;Alpha&amp;quot; /&amp;gt;
        &amp;lt;Static Index=&amp;quot;57&amp;quot; BlendMode=&amp;quot;Alpha&amp;quot; /&amp;gt;
        &amp;lt;Static Index=&amp;quot;58&amp;quot; BlendMode=&amp;quot;Alpha&amp;quot; /&amp;gt;
        &amp;lt;Static Index=&amp;quot;57&amp;quot; BlendMode=&amp;quot;Alpha&amp;quot; /&amp;gt;
    &amp;lt;/Frames&amp;gt;
&amp;lt;/Animated&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

The above is the actual data for the waterfall tile animation used in the demo code.&lt;br /&gt;
&lt;br /&gt;
Here you can see that the &amp;lt;Animated&amp;gt; tag specifies a frame interval in milliseconds (100ms in this case). It contains a &amp;lt;Frames&amp;gt; child element that in turn contains a mix of &amp;lt;TileSheet&amp;gt; and &amp;lt;Static&amp;gt; child elements. The &amp;lt;TileSheet&amp;gt; tag is required whenever a tilesheet is changed (you might have more interspersed within the &amp;lt;Frames&amp;gt; tag if the animation spans several tilesheets. The &amp;lt;Static&amp;gt; tag essentially refers to a particular tile by index (assuming the last specified tilesheet) and the BlendMode specifies the blending mode to be applied (xTile supports Alpha and Additive blending). Note that the &amp;lt;Static&amp;gt; tag is identical to the one used for regular non-animated tiles, except that when specified within an &amp;lt;Animated&amp;gt; tag, they describe one particular frame within the animation.&lt;br /&gt;
&lt;br /&gt;
Hope that helps.&lt;br /&gt;
&lt;/div&gt;</description><author>colinvella</author><pubDate>Sun, 12 May 2013 18:42:09 GMT</pubDate><guid isPermaLink="false">New Post: Accessing tile animation data 20130512064209P</guid></item><item><title>New Post: Accessing tile animation data</title><link>http://tide.codeplex.com/discussions/443324</link><description>&lt;div style="line-height: normal;"&gt;Hi!&lt;br /&gt;
Been using tIDE and it works very well. I've decided however to use my own code for rendering in XNA, and i'm having trouble figuring out how to access animation data for a tile. I want access to the actual frame indices of an animated tile.&lt;br /&gt;
&lt;br /&gt;
From what I can tell, Tile.Properties is only for custom properties set in the editor for a given tile. Tile.TileIndexProperties would seem like it could prove helpful but it is always empty.&lt;br /&gt;
&lt;br /&gt;
Anyone had any luck with this?&lt;br /&gt;
&lt;br /&gt;
/Jakob&lt;br /&gt;
&lt;/div&gt;</description><author>JakobB</author><pubDate>Sat, 11 May 2013 08:21:23 GMT</pubDate><guid isPermaLink="false">New Post: Accessing tile animation data 20130511082123A</guid></item><item><title>New Post: MonoGame</title><link>http://tide.codeplex.com/discussions/394847</link><description>&lt;div style="line-height: normal;"&gt;Brilliant! Thanks for sharing this! :)&lt;br /&gt;
&lt;/div&gt;</description><author>colinvella</author><pubDate>Fri, 10 May 2013 08:37:16 GMT</pubDate><guid isPermaLink="false">New Post: MonoGame 20130510083716A</guid></item><item><title>New Post: MonoGame</title><link>http://tide.codeplex.com/discussions/394847</link><description>&lt;div style="line-height: normal;"&gt;Using pre-compiled content, I had no problem getting the xTile demo to run on PSMobile via MonoGame.&lt;br /&gt;
&lt;br /&gt;
&lt;img src="https://pbs.twimg.com/media/BJ3CHpCCQAAtdNo.jpg:large" alt="Image" /&gt;&lt;br /&gt;
&lt;br /&gt;
I put the project together if anyone wants to use xTile on a Vita game... &lt;a href="https://dl.dropboxusercontent.com/u/23693330/xTile_PSMobile.zip" rel="nofollow"&gt;https://dl.dropboxusercontent.com/u/23693330/xTile_PSMobile.zip&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>F8_Sean</author><pubDate>Fri, 10 May 2013 01:54:02 GMT</pubDate><guid isPermaLink="false">New Post: MonoGame 20130510015402A</guid></item><item><title>New Post: error with the tutorial</title><link>http://tide.codeplex.com/discussions/440496</link><description>&lt;div style="line-height: normal;"&gt;
&lt;div dir="ltr"&gt;Start by searching &amp;quot;collision&amp;quot; on the project forums. There are several discussions, some also point to external xTile tutorials that cover collision detection.&lt;/div&gt;
&lt;div&gt;&lt;br&gt;
&lt;br&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description><author>colinvella</author><pubDate>Fri, 19 Apr 2013 15:03:34 GMT</pubDate><guid isPermaLink="false">New Post: error with the tutorial 20130419030334P</guid></item><item><title>New Post: error with the tutorial</title><link>http://tide.codeplex.com/discussions/440496</link><description>&lt;div style="line-height: normal;"&gt;That fixed it :D thanks... Where do I go from here if you don't mind pointing me in the right direction to learn how to do collision and other useful things?&lt;br /&gt;
&lt;/div&gt;</description><author>fundo</author><pubDate>Fri, 19 Apr 2013 14:41:36 GMT</pubDate><guid isPermaLink="false">New Post: error with the tutorial 20130419024136P</guid></item><item><title>New Post: Linux Support</title><link>http://tide.codeplex.com/discussions/440668</link><description>&lt;div style="line-height: normal;"&gt;A member of the community did manage to get the xTile engine to run on Monogame. Check this &lt;a href="https://tide.codeplex.com/discussions/394847" rel="nofollow"&gt;discussion&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
As for the tIDE editor, can you still work on a Windows box?&lt;br /&gt;
&lt;/div&gt;</description><author>colinvella</author><pubDate>Fri, 19 Apr 2013 11:51:50 GMT</pubDate><guid isPermaLink="false">New Post: Linux Support 20130419115150A</guid></item><item><title>New Post: error with the tutorial</title><link>http://tide.codeplex.com/discussions/440496</link><description>&lt;div style="line-height: normal;"&gt;I would look at whether you initialised the &lt;strong&gt;map&lt;/strong&gt; reference first.&lt;br /&gt;
&lt;/div&gt;</description><author>colinvella</author><pubDate>Fri, 19 Apr 2013 11:48:34 GMT</pubDate><guid isPermaLink="false">New Post: error with the tutorial 20130419114834A</guid></item><item><title>New Post: Linux Support</title><link>http://tide.codeplex.com/discussions/440668</link><description>&lt;div style="line-height: normal;"&gt;With Steam making a push to the Linux desktop.. it would be nice to have development tools for it as well.. &lt;br /&gt;
Currently the only Linux Tile map editor is Tiled.. it would be nice to get tIDE on here as well.&lt;br /&gt;
&lt;br /&gt;
Would it be possible to utilize MonoGame so this project would reach multiple platforms.&lt;br /&gt;
&lt;br /&gt;
Thanks!&lt;br /&gt;
&lt;/div&gt;</description><author>Disk1of5</author><pubDate>Wed, 17 Apr 2013 21:05:17 GMT</pubDate><guid isPermaLink="false">New Post: Linux Support 20130417090517P</guid></item><item><title>New Post: error with the tutorial</title><link>http://tide.codeplex.com/discussions/440496</link><description>&lt;div style="line-height: normal;"&gt;I downloaded the engine and the tutorial contents. I set it up and it compiled but when I run it shows me this error:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An handled exception of type ' System.NullReferenceException' occurred in xTileGame1.exe&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additional information: Object reference not set to an instance of an object&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
then it highlights (in yellow) this line in the code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
map.LoadTileSheets(mapDisplayDevice);&lt;br /&gt;
&lt;br /&gt;
does anyone know what happened or what I did wrong?&lt;br /&gt;
&lt;/div&gt;</description><author>fundo</author><pubDate>Tue, 16 Apr 2013 17:36:05 GMT</pubDate><guid isPermaLink="false">New Post: error with the tutorial 20130416053605P</guid></item><item><title>New Post: How i add enemyes?</title><link>http://tide.codeplex.com/discussions/439784</link><description>&lt;div style="line-height: normal;"&gt;yes but how i place for facilitate my task&lt;br /&gt;
&lt;/div&gt;</description><author>sergigandia</author><pubDate>Wed, 10 Apr 2013 20:18:07 GMT</pubDate><guid isPermaLink="false">New Post: How i add enemyes? 20130410081807P</guid></item></channel></rss>