How Do I show An Image?

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Playerdark
Quite a regular
Quite a regular
Posts: 47
Joined: Fri May 28, 2010 04:40

How Do I show An Image?

Postby Playerdark » Thu Dec 02, 2010 05:15

I am trying to show an image in a default window, since I learned from the widgetgalore page that there is no StaticImage class.
Now, I believe I load an imageset like so:

mpc_healthbar_image_set = & CEGUI::ImagesetManager::getSingleton().createFromImageFile( "healthbars", "healthbar.tga", "Imagesets" );

then I define a bunch of partial images in them:

Code: Select all

   for( s32_index = 0, s32_actual_percent = 0; s32_index < 20; s32_index ++ )
   {
      sprintf( zs_image_name, "percent_%03u", s32_actual_percent );
      mpc_healthbar_image_set->defineImage( zs_image_name, CEGUI::Vector2(0.0f, 0.0f ), CEGUI::Size( (float) s32_actual_percent, 10.0f ), CEGUI::Vector2(0.0f, 0.0f ) );
      s32_actual_percent += 5;
   } // for


and then I try to select an image in a simple default window I have created like this:

s_infobox.pc_health_bar->setProperty( String("Image"), String("healthbars") );

and the result is nothing.

I understand I probably have to select one of the images in the imageset somehow but I have no idea how. I admit I dont really know how to set "properties" other than in the layout editor, I tried to find an explanation for that too but failed. So is there a simple way that I can show an image in a window? Right now I'm strongly considering the tought of just using a bunch of "xxxxx" to show the healthbar since I have no idea how to make CEGUI show the picture

Thanks

Playerdark
Quite a regular
Quite a regular
Posts: 47
Joined: Fri May 28, 2010 04:40

Re: How Do I show An Image?

Postby Playerdark » Thu Dec 02, 2010 05:32

Ok, updating on my own post, I found out that the correct way to select and show an image is something like:

Code: Select all

   s_infobox.pc_health_bar->setProperty( String("Image"), String("set:healthbars image:percent_050") );


in my case. After debugging into the library sourcecode I was able to find a scanf() statement somewhere from which I could derive the above syntax. Seriously, stuff like that should be in a manual. If no manual is on the drawingboard, at least there should be a forum here where things like this can be collected in a simple and working "How To" section. Nobody should have to debug calls in a 3rd party library to find out how to use said calls, free or not. I bet there are a bunch of posts like this in the forum from which a How To can easily be derived with a few minute work for somebody who knows the library well enough. This should seriously be considered. If there was something like that it would be 5 minutes work for me to cleanup my post and post it there.

User avatar
Mikademus
CEGUI MVP
CEGUI MVP
Posts: 130
Joined: Wed Mar 18, 2009 19:14

Re: How Do I show An Image?

Postby Mikademus » Thu Dec 02, 2010 11:38

I agree with you that stuff like this is basic and should be covered in some kind of documentation. My suggestion is to make a "Cookbook" or "How-to" section in the wiki and fill in this as the first recipe. I and others will add to it and refer to it when more questions arise.

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: How Do I show An Image?

Postby Kulik » Thu Dec 02, 2010 12:56

I agree that these little snippets should be documented somewhere. The wiki is definitely the place for these to be. Don't hesitate to add them there (use your forum login as wiki login). When more of them are there, they could be reorganized into a category.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: How Do I show An Image?

Postby Jamarr » Thu Dec 02, 2010 18:19

Playerdark wrote:Seriously, stuff like that should be in a manual. If no manual is on the drawingboard, at least there should be a forum here where things like this can be collected in a simple and working "How To" section.


You can easily (within 5 minutes) find your answer by searching: 1) the wiki 2) the forums and 3) google. In fact, I just found multiple answers to your question by searching all 3 sources, likely in less time than it cost you to make this post. In fact, there is an example on the widgetgalore page you reference. Seriously.

Nobody should have to debug calls in a 3rd party library to find out how to use said calls, free or not.


Nobody is forcing you to use free libraries. By all means, feel free to write your own sophisticated GUI library, release it for free to the public, and you too can enjoy the abundance of whiny, snot nosed brats who've become so delusional, no doubt through high societies spoiled nature, that they cannot fathom having to spend a single moment of their time figuring out a problem by themselves. No, they must ask you for the answer and they demand that you provide it or be scorned by their obvious superiority complex.

I bet there are a bunch of posts like this in the forum from which a How To can easily be derived with a few minute work for somebody who knows the library well enough.


Perhaps you should stop and consider that maybe, just maybe, not everyone else has or had the problem you did? Maybe, just maybe, up until this point there was no need for anyone to have added this information to the wiki. Coincidentally, and thankfully so, there are very few posts like this one. Probably because most people know what a search tool is, and know how to use it effectively.

This should seriously be considered. If there was something like that it would be 5 minutes work for me to cleanup my post and post it there.


You should think twice before coming to a free forum, offering free support, for a free library and making absurd demands for information that is readily available. We work for free, and we can only put in a limited amount of time for free. If you happen upon some missing information, then perhaps you, like many before you, can log into the wiki and contribute a small amount of information for a library that will likely save you hundreds, if not thousands, of hours.

I understand that the written word can be easily miss construed and miss perceived, especially when the author has little experience communicating in this medium. So let me give you a hint, If you wish to make a friendly suggestion there is no need to include contrived observations, sarcastic remarks, or to throw around fallacies as if they were fact; especially when your observations are plain wrong, and especially when it involves a system you are hardly, if at all, familiar with.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

Playerdark
Quite a regular
Quite a regular
Posts: 47
Joined: Fri May 28, 2010 04:40

Re: How Do I show An Image?

Postby Playerdark » Fri Dec 03, 2010 07:52

You know answers like that are the precise reason why I was hesitant to make the post in the first place. Whenever I try to tell people who make free libraries that their libraries are useless for most people unless they also write a manual I get a: A) youre a leech, using a free library and you dare demand something? B) Write your own or C) debug the code.

Let me make it slow for you: Most people use a library because they either dont have the time or can not write a library. They also don't feel like or aren't able to dig through the code until they find an answer to their question. And why should they? I am not in such a desperate need of a GUI library. Had I not found CEGUI I wouldn't have switched from Irrlicht to Ogre in the first place because Ogre is completely useless without a GUI library, but Irrlicht has one, so I would have accepted Irrlicht's shortcomings compared to Ogre. That said, I really don't get why Open Source developers take such pride in never delivering a manual. It is simply an incomplete product, plain and simple. People will use the fraction of the library they can understand and all the rest is left for the crack dudes who understand the whole code, but it's useless to write it in the first place if no newcomer can use it.

And for your information, I did an "ueber GUI" back in the days of Modula2 and it was sold by a swiss company and it had a fat manual and that's why it was sold, otherwise nobody would have been able to use it, so don't think it's because I'm too dumb or lazy that I use CEGUI. It's because I am working on a game not on a GUI library and I don't intend to waste my spare time debugging other people's code. I was offering to help by putting the solutions I find in a forum or Wiki like the other poster suggested, but I guess that's not necessary since clever people like you don't need it. So stick with the hacker level because no library will ever rise above it when there is no manual. I knew that I would get your standard response sooner or later that's why I didnt want to post this whole thing anyway and usually don't participate and I guess that's the state I assume after this post again.

Cya

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: How Do I show An Image?

Postby Kulik » Fri Dec 03, 2010 08:02

Yeah we know documentation is lacking at places (I still believe most open source projects aren't better in this aspect). Why isn't there more documentation? Because we don't consider it fun to document stuff. If you are good at documenting, help us please. Contributions in this area are much appreciated.

User avatar
Mikademus
CEGUI MVP
CEGUI MVP
Posts: 130
Joined: Wed Mar 18, 2009 19:14

Re: How Do I show An Image?

Postby Mikademus » Fri Dec 03, 2010 10:45

For what it is worth, I understand your frustration. I too have many times been frustrated by how to use 3rd party systems, and then again by not getting help from the community surrounding it. I sort of felt in your post what I too have experienced many times. So I think both your reaction and that of Jamarr's are understandable and I sympathise with both: you are frustrated and Jamarr feels unappreciated on behalf of CEGUI - both are right from their own understanding of the situation. Normal forum sentiments. Now I hope that we can all help with improving the documentation situation! Note thought that especially improving the Wiki has been discussed for a few months now and changes and improvement are intended to come sort of together with the release of 0.8.0 as I understand it.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: How Do I show An Image?

Postby Jamarr » Fri Dec 03, 2010 20:06

So by your exclusion we can all agree that you have accepted the information you were originally after, was in fact available had you bothered to spend two minutes searching for it. It seems we are making a little progress here. Of course, your rebuttal is nothing more but a rambling on of your previous post. Are you so delicate that you cannot admit when you have clearly insulted those offering you a free product, and free support? I do find this rant quite amusing, so I will

Playerdark wrote:You know answers like that are the precise reason why I was hesitant to make the post in the first place.


I can only assume this is because you have prior experience making demands of free, open-source projects?

Whenever I try to tell people who make free libraries that their libraries are useless for most people unless they also write a manual I get a: A) you're a leech, using a free library and you dare demand something? B) Write your own or C) debug the code.


Maybe that is because A) you are exuding the behavior of a leech, B) would be more satisfied with your own work, or C) may need to further your debugging skills.

On a less sarcastic note, maybe the community is already aware of their lack of documentation and/or where their documentation could use improvement. Do you not understand "work in progress"? Do you not understand "limited free time"? You do not go around insulting a free project because it does not meet your needs. That is rude and you are likely to be shunned by those community members who have already contributed some of their free time to the project. Instead of telling people what their project needs, you can just as easily rephrase your annoyances as suggestions; you are far less likely to be looked down upon as ignorant and unsophisticated.

Let me make it slow for you:


Insults only reveal your ignorance and stifle your own arguments. A discussion has never benefited from nor progressed a subject by lowering oneself to such childish games.

Most people use a library because they either dont have the time or can not write a library.


Then they should sympathize with the community members, and understand that free time is a limited quantity.

They also don't feel like or aren't able to dig through the code until they find an answer to their question. And why should they?


And why should a developer or community member waste their own time trying to help you out by searching through the documentation, wiki, forums, and code just to answer your question. They have no obligation to do so; you should be so lucky to receive any help at all, for free.

I really don't get why Open Source developers take such pride in never delivering a manual. It is simply an incomplete product, plain and simple. People will use the fraction of the library they can understand and all the rest is left for the crack dudes who understand the whole code, but it's useless to write it in the first place if no newcomer can use it.


First off, no one here is "taking pride in [not] delivering a manual." Are you really so arrogant as to put false words in the communities mouth? Neither has anyone in the community proclaimed CEGUI to be a "complete" product. And as far as documentation is concerned, you can certainly raise it to a level such that the average developer can find it useful. However, you can never write enough documentation for every newcomer to immediately understand everything they want to use a library for. If you think otherwise, you have no real experience in the matter. Knowing how to use your development tools, knowing how to find answers, and knowing how to debug code are all core requirements of even being considered an amateur, much less a professional. You do not jump on a free, open-source libraries forums and expect to be baby stepped through every conceivable usage of the library because you are so conceited that you believe your time is more valuable than anyone else. That is naive.

And for your information, I did an "ueber GUI" back in the days of Modula2 and it was sold by a swiss company and it had a fat manual and that's why it was sold, otherwise nobody would have been able to use it, so don't think it's because I'm too dumb or lazy that I use CEGUI.


Is this supposed to be surprising? Only an idiot would buy a product with no documentation. And herein lies your confusion: CEGUI is not being sold, nor is there any intention of selling it. As the CEGUI license states: "THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT." Let that sink in for a moment.

It's because I am working on a game not on a GUI library and I don't intend to waste my spare time debugging other people's code.


This is a direct insult to everyone who has ever contributed to CEGUI. How dare you mock those who freely give their time with your absurdities. If you think your time is so much more valuable than ours, then you can keep it. And if you think that working on a game is as simple as playing kinex or leggos, you are in for a rude awakening.

I was offering to help by putting the solutions I find in a forum or Wiki like the other poster suggested, but I guess that's not necessary since clever people like you don't need it. So stick with the hacker level because no library will ever rise above it when there is no manual.


You demanded that the community create a how-to out of topics that already exists and can be easily found in the forum. And then you mock the community for not doing so. You then proceed to claim that your time is more valuable than anyone else here, and that they should stop whatever their lives ask of them to prioritize your needs over their own. My first thought upon reading this thread was, "obvious troll is obvious?"

I knew that I would get your standard response sooner or later that's why I didnt want to post this whole thing anyway and usually don't participate and I guess that's the state I assume after this post again.


obvious troll is obvious?

/sarcasmoff
To take you seriously, for but a moment, we do appreciate everyone who contributes something back in the form of code, snippets, documentation, wiki improvements, donations, and the like. In fact, we praise such acts of generosity because we can empathize with taking time out of our busy lives to contribute something back to a project that has given us so much more for free. I am not trying to scare you off. I am not trying to insult. I am simply trying to make you understand our point of view. All you need have done is used the available tools (search) to find your answer, and if you found finding that answer difficult a simple "hey, I found it difficult to find [such and such information]. I think it would be beneficial for others if there were a how-to guide on the wiki for things like this." to which we would have replied, "yeah, that sounds like a good idea. you know, you can login to the wiki using your forum login and start that page yourself. if you take the time to start it, I am sure that others will see your contribution and find a willingness of their own to contribute something as well." In short, all I am trying to say is that you need to work on your forum etiquette.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: How Do I show An Image?

Postby Kulik » Fri Dec 03, 2010 20:57

Jamarr wrote:To take you seriously, for but a moment, we do appreciate everyone who contributes something back in the form of code, snippets, documentation, wiki improvements, donations, and the like. In fact, we praise such acts of generosity because we can empathize with taking time out of our busy lives to contribute something back to a project that has given us so much more for free. I am not trying to scare you off. I am not trying to insult. I am simply trying to make you understand our point of view. All you need have done is used the available tools (search) to find your answer, and if you found finding that answer difficult a simple "hey, I found it difficult to find [such and such information]. I think it would be beneficial for others if there were a how-to guide on the wiki for things like this." to which we would have replied, "yeah, that sounds like a good idea. you know, you can login to the wiki using your forum login and start that page yourself. if you take the time to start it, I am sure that others will see your contribution and find a willingness of their own to contribute something as well." In short, all I am trying to say is that you need to work on your forum etiquette.


This exactly describes "the wiki problem". It is hard to motivate myself to write some documentation when rarely is anybody willing to write/edit anything in the wiki. The wiki should be edited organically. Sure you don't have time to write the whole page but if you dismiss creating it altogether just because of that, it's never gonna get done. Instead just create a skeleton, put something inside it, note what is missing. Then a week later or something you come back and edit some more. It is very likely that somebody else will read it and fix mistakes or add some more stuff.

Ranting on a public forum believing that documentation will magically appear is not likely to work. Mainly because you have no leverage. But realize that we indeed do appreciate people who contribute back and if you contribute, your future suggestions will likely be taken more seriously.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 13 guests