Pages: 1
Posted on 08-03-11, 05:19 am
Banned for being a complete idiot.

Karma: 529
Posts: 90/987
Since: 07-09-11
Hey guys,
Here's my notes/tutorial on adding an icon for a sprite for NSMBe!

---

replace {spriteNumber} with sprite number.
replace {spriteWidth} with sprite width in pixels.
replace {spriteHeight} with sprite height in pixels.
replace {spriteName} with name of icon file.

Note: For "case", you should put them in chronological order.
Your icon should go under NSMBe4\Resources\Sprite Images
Your icon should be a .png

NSMBSprite.cs

Rectange getRect()

...

case {spriteNumber}:
width = {spriteWidth};
height = {spriteHeight};
break:

...

bool Render(Graphics g)

...

case {spriteNumber}:
g.DrawImage(Properties.Resources.{spriteName}, RenderX, RenderY, <spriteWidth>, <spriteHeight>);
break;

...

Resources.resx (right-click -> Edit code)

...

<data name="{spriteName}" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Sprite Images\{spriteName}.PNG;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>

...
Posted on 08-03-11, 01:20 pm
Fuzzy
Full mod

Karma: 1183
Posts: 90/785
Since: 06-28-11
You shouldn't have to manually edit resources.resx. You can add a resource by going to Project->NSMBe4 Properties, click the resources tab, click the arrow next to add resource and click add existing file.
Posted on 08-03-11, 04:01 pm
Banned for being a complete idiot.

Karma: 529
Posts: 96/987
Since: 07-09-11
Yea, I just noticed that after I posted this tutorial.

But both ways end up with the same results, don't they?
Posted on 08-03-11, 04:12 pm
Fuzzy
Full mod

Karma: 1183
Posts: 92/785
Since: 06-28-11
They should produce the same result, but it should be harder to screw it up when adding the resource with Visual Studio.
Pages: 1