Skip to main content
replaced http://gamedev.stackexchange.com/ with https://gamedev.stackexchange.com/
Source Link

I've been trying to use this modified version of GLEED2D that includes WP7 support,

The progress so far, is I've been able to load the level XML file to the project and read it successfully thanks to This answerThis answer

I got in touch with the author of the modified version, he added the answer to the wiki

The problem now is I cannot implement the following steps, according to the wiki, I now need to:

"enumerate the levels and then enumerate each item in each level. For each item, add the object/sprite into XNA."

My initialize() method now looks like this

 protected override void Initialize() { Stream stream = TitleContainer.OpenStream("Content/leveltest.xml"); //Stream stream = TitleContainer.OpenStream("Content/level.gleed"); XElement xml = XElement.Load(stream); level = LevelLoader.Load(xml); base.Initialize(); } 

When I debug I find the level object loaded successfully and has list of layers and list of items inside the layers, but I'm not sure how to continue my way from here to Display the level items on the screen.

Any idea?

--UPDATE--

I added

foreach (Layer layer in level.Layers) { foreach (LayerItem item in layer.Items) { item.Properties.Visible = true; //something should be added here to draw } } 

I am not sure what to add now to draw the item into it's position on screen !?

I've been trying to use this modified version of GLEED2D that includes WP7 support,

The progress so far, is I've been able to load the level XML file to the project and read it successfully thanks to This answer

I got in touch with the author of the modified version, he added the answer to the wiki

The problem now is I cannot implement the following steps, according to the wiki, I now need to:

"enumerate the levels and then enumerate each item in each level. For each item, add the object/sprite into XNA."

My initialize() method now looks like this

 protected override void Initialize() { Stream stream = TitleContainer.OpenStream("Content/leveltest.xml"); //Stream stream = TitleContainer.OpenStream("Content/level.gleed"); XElement xml = XElement.Load(stream); level = LevelLoader.Load(xml); base.Initialize(); } 

When I debug I find the level object loaded successfully and has list of layers and list of items inside the layers, but I'm not sure how to continue my way from here to Display the level items on the screen.

Any idea?

--UPDATE--

I added

foreach (Layer layer in level.Layers) { foreach (LayerItem item in layer.Items) { item.Properties.Visible = true; //something should be added here to draw } } 

I am not sure what to add now to draw the item into it's position on screen !?

I've been trying to use this modified version of GLEED2D that includes WP7 support,

The progress so far, is I've been able to load the level XML file to the project and read it successfully thanks to This answer

I got in touch with the author of the modified version, he added the answer to the wiki

The problem now is I cannot implement the following steps, according to the wiki, I now need to:

"enumerate the levels and then enumerate each item in each level. For each item, add the object/sprite into XNA."

My initialize() method now looks like this

 protected override void Initialize() { Stream stream = TitleContainer.OpenStream("Content/leveltest.xml"); //Stream stream = TitleContainer.OpenStream("Content/level.gleed"); XElement xml = XElement.Load(stream); level = LevelLoader.Load(xml); base.Initialize(); } 

When I debug I find the level object loaded successfully and has list of layers and list of items inside the layers, but I'm not sure how to continue my way from here to Display the level items on the screen.

Any idea?

--UPDATE--

I added

foreach (Layer layer in level.Layers) { foreach (LayerItem item in layer.Items) { item.Properties.Visible = true; //something should be added here to draw } } 

I am not sure what to add now to draw the item into it's position on screen !?

added 338 characters in body
Source Link
smohamed
  • 173
  • 1
  • 8

I've been trying to use this modified version of GLEED2D that includes WP7 support,

The progress so far, is I've been able to load the level XML file to the project and read it successfully thanks to This answer

I got in touch with the author of the modified version, he added the answer to the wiki

The problem now is I cannot implement the following steps, according to the wiki, I now need to:

"enumerate the levels and then enumerate each item in each level. For each item, add the object/sprite into XNA."

My initialize() method now looks like this

 protected override void Initialize() { Stream stream = TitleContainer.OpenStream("Content/leveltest.xml"); //Stream stream = TitleContainer.OpenStream("Content/level.gleed"); XElement xml = XElement.Load(stream); level = LevelLoader.Load(xml); base.Initialize(); } 

When I debug I find the level object loaded successfully and has list of layers and list of items inside the layers, but I'm not sure how to continue my way from here to Display the level items on the screen.

Any idea?

--UPDATE--

I added

foreach (Layer layer in level.Layers) { foreach (LayerItem item in layer.Items) { item.Properties.Visible = true; //something should be added here to draw } } 

I am not sure what to add now to draw the item into it's position on screen !?

I've been trying to use this modified version of GLEED2D that includes WP7 support,

The progress so far, is I've been able to load the level XML file to the project and read it successfully thanks to This answer

I got in touch with the author of the modified version, he added the answer to the wiki

The problem now is I cannot implement the following steps, according to the wiki, I now need to:

"enumerate the levels and then enumerate each item in each level. For each item, add the object/sprite into XNA."

My initialize() method now looks like this

 protected override void Initialize() { Stream stream = TitleContainer.OpenStream("Content/leveltest.xml"); //Stream stream = TitleContainer.OpenStream("Content/level.gleed"); XElement xml = XElement.Load(stream); level = LevelLoader.Load(xml); base.Initialize(); } 

When I debug I find the level object loaded successfully and has list of layers and list of items inside the layers, but I'm not sure how to continue my way from here to Display the level items on the screen.

Any idea?

I've been trying to use this modified version of GLEED2D that includes WP7 support,

The progress so far, is I've been able to load the level XML file to the project and read it successfully thanks to This answer

I got in touch with the author of the modified version, he added the answer to the wiki

The problem now is I cannot implement the following steps, according to the wiki, I now need to:

"enumerate the levels and then enumerate each item in each level. For each item, add the object/sprite into XNA."

My initialize() method now looks like this

 protected override void Initialize() { Stream stream = TitleContainer.OpenStream("Content/leveltest.xml"); //Stream stream = TitleContainer.OpenStream("Content/level.gleed"); XElement xml = XElement.Load(stream); level = LevelLoader.Load(xml); base.Initialize(); } 

When I debug I find the level object loaded successfully and has list of layers and list of items inside the layers, but I'm not sure how to continue my way from here to Display the level items on the screen.

Any idea?

--UPDATE--

I added

foreach (Layer layer in level.Layers) { foreach (LayerItem item in layer.Items) { item.Properties.Visible = true; //something should be added here to draw } } 

I am not sure what to add now to draw the item into it's position on screen !?

Source Link
smohamed
  • 173
  • 1
  • 8

Loading and using GLEED2D levels into WP7 Game

I've been trying to use this modified version of GLEED2D that includes WP7 support,

The progress so far, is I've been able to load the level XML file to the project and read it successfully thanks to This answer

I got in touch with the author of the modified version, he added the answer to the wiki

The problem now is I cannot implement the following steps, according to the wiki, I now need to:

"enumerate the levels and then enumerate each item in each level. For each item, add the object/sprite into XNA."

My initialize() method now looks like this

 protected override void Initialize() { Stream stream = TitleContainer.OpenStream("Content/leveltest.xml"); //Stream stream = TitleContainer.OpenStream("Content/level.gleed"); XElement xml = XElement.Load(stream); level = LevelLoader.Load(xml); base.Initialize(); } 

When I debug I find the level object loaded successfully and has list of layers and list of items inside the layers, but I'm not sure how to continue my way from here to Display the level items on the screen.

Any idea?