Adam's Lair Forum

game development and casual madness
It is currently 2018/08/15, 19:20

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 2018/06/12, 20:23 
Newbie
Newbie

Joined: 2018/01/01, 07:53
Posts: 3
Role: Hobbyist
I have a custom Component, SpawnPoint, that I use to handle spawning players at a random spawn point of their team color. I'm trying to give the Component a custom icon by setting EditorHintImage attribute, but it just defaults to the folder icon. Can someone help me figure out where I'm going wrong?

In SpawnPoint.cs:
Code:
[EditorHintImage(ResNames.ImageSpawnPoint)]
public class SpawnPoint : Component, ICmpRenderer
{
     // normal Component code
}


In ResNames.cs:
Code:
public static class ResNames
{
     private const string ManifestBaseName = "TestGame.EmbeddedResources.";
     public const string Category = "TestGame";
     public const string ImageSpawnPoint = ManifestBaseName + "iconResSpawnPoint.png";
}


In my CorePlugin project, I've created a folder "EmbeddedResources". Inside is my 16x16 image with the name iconResSpawnPoint.png. Is there anything else I need in that folder to make it work?


Top
 Profile  
 
PostPosted: 2018/06/12, 21:18 
Forum Addict
Forum Addict
User avatar

Joined: 2013/09/19, 14:31
Posts: 872
Location: Italy
Role: Hobbyist
Hi, and welcome to the gang :mrgreen:

Did you set your pngs as Embedded Resources as compile action?

_________________
Come on Duality's Discord channel. We have cookies! :mrgreen:


Top
 Profile  
 
PostPosted: 2018/06/12, 21:40 
Newbie
Newbie

Joined: 2018/01/01, 07:53
Posts: 3
Role: Hobbyist
SirePi wrote:
Did you set your pngs as Embedded Resources as compile action?


I thought that Visual Studio automatically handled that. I changed the build action in Visual Studio to "Embedded Resource" and it works great now. Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group