Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Cierpliwy

Pages: [1] 2
1
Feature requests / New class for SFML2: TextArea.
« on: March 21, 2010, 05:27:17 pm »
Unfortunately, I probably won't finish this class because I'm hardly studying, now ;/ I also encounter many issues and problems while implementing my vision of TextArea. It was quite hard to do this!

Also I lost my main code due to small accident. So I can't even give sources to someone who would like to continue my job. Sorry for that. It's my mistake.

2
Graphics / draw ellipses
« on: January 05, 2010, 10:00:19 pm »
SFML doesn't support such primitives, or am i wrong?

So I would try to draw them using fragment shader if it's not a problem for you. :)

3
Feature requests / New class for SFML2: TextArea.
« on: January 05, 2010, 05:26:17 pm »
I just want to communicate that I'm still writing my TextArea class. I've finally done parsing part, so the worst is behind me ;) If there aren't any bigger problems, Maybe I'll finish it today or tomorrow. I'll also create new topic in SFML Projects for that purpose. :)

4
Graphics / clipping and blitting sprite sheets
« on: January 02, 2010, 01:26:23 am »
Is it so hard to read documentation? Use function sf::Sprite::SetSubRect (const IntRect & SubRect) to do what you want.

5
General discussions / Merry Xmas !
« on: December 24, 2009, 11:02:54 pm »
I also wish you happy and Merry Christmas :)

6
Feature requests / New class for SFML2: TextArea.
« on: December 22, 2009, 09:41:53 am »
If I finish stable version of TextArea, I'll surely put it there and translate comments as well. Now, my implementation is too bloated, complicated and limited (about 1000 lines of code). So Version 0.2 won't appear very soon, unfortunately :(

PS. It's not Russian, It's polish :)

7
General discussions / Build From Source For 2010
« on: December 21, 2009, 03:47:59 pm »
I think that someone should do MSVC++ 2010 SFML project from scratch and then commit to SVN. If Laurent can't do it, maybe someone else can?

8
Feature requests / New class for SFML2: TextArea.
« on: December 20, 2009, 12:18:25 pm »
After look at the ver. 0.1, code seems to be very, very buggy. But I hope Ver 0.2 will be the stable one. Maybe I'll finish it today :) I'll check your fix soon Laurent.

9
Feature requests / New class for SFML2: TextArea.
« on: December 19, 2009, 06:36:32 pm »
Yep, I coded version 0.1 in hurry so quality of code is much lower then it should be.

BlockDebug() is simple function for my debug purposes :D Call it after Parse() method and you'll see what it does.

10
Feature requests / New class for SFML2: TextArea.
« on: December 19, 2009, 05:32:35 pm »
Quote
I know. I'm not 100% satisfied with the sf::String API, I'm hoping to find a better solution one day.


It would be really cool to operate on string by using only sf::Strings functions. Now I have to convert sf::String to std::wstring which takes time.

Please tell me what features should I add to TextArea class! ;)

11
Feature requests / New class for SFML2: TextArea.
« on: December 19, 2009, 04:26:27 pm »
Ok.. I programmed a bit. It was about ~500 lines of code to implement basic TextArea class.

What i have done:

Added tags:
<b></b>
<u></u>
<i></i>
<size=xx></size>, where xx is number: 09, 12, 89
<color=xxx.xxx.xxx></color>, where xxx is number: 001, 034, 234
<align=x></align>, where x is: c-center, l-left, r-right, j-justify

Problems:
- if tags are inside word, word can split up.
- if word width is higher then rectangle width there is undefined behavior.
- space between lines.
- you need add enter before </align> tab otherwise last line will be aligned improperly.

To Laurent:
- What about a sf::Text feature which will easily give you metrics for special characters like: space, tab, new line.
- I miss std::string functions in sf::String, such as substr().
- Do you control bold effect in fonts? As you can see in the picture, small font with bold style are too fat.

What I want to do:
- Add link tag <l> which will will don't split up two linked words
- Rewrite some parts of code to be more clearly and have better performance.
- Render to texture.
- If implementation will be stable I'll rewrite comments in source code (now they are unfortunately in polish).
- Fixed tab size?

Demo render:


Parse time: ~0.15 s.
Render time: ~0.02 s.

How to use:

Create object TextArea and set string, rect and font. After that, before rendering parse the text. In main application loop render it.

Code: [Select]

//This code before rendering:
TextArea ta;
TextArea ta;
ta.SetRectArea( sf::FloatRect(20,20,780,580) );
ta.SetFont( font );
ta.SetString( myString );
ta.Parse();

//This code between app.Clear() and app.Display():
ta.Render(app);


Put this files in your project:
- http://paste-it.net/public/q98ffc4/
- http://paste-it.net/public/jc6dcfd/

I'm waiting for your opinions and propositions.

12
Feature requests / New class for SFML2: TextArea.
« on: December 18, 2009, 07:15:07 pm »
Quote
Why only adding a TextArea and not other GUI components as well?


I'm creating TextArea to use it everywhere when it is possible, also in controls, widgets and windows. It won't depend on anything and be as simple as possible.

13
Feature requests / New class for SFML2: TextArea.
« on: December 18, 2009, 06:30:20 pm »
My bad that i've never visited SFML Wiki :D Now I understand why Laurent doesn't accept my idea.

thiziri: I'll try to write such an extension ;)

14
Feature requests / New class for SFML2: TextArea.
« on: December 18, 2009, 05:56:56 pm »
But what about people who won't write something like this by themselves because it will be to hard to do it. I know it's high level, it's hard to maintain but... it's really important. In every basic game there is a need to draw huge parts of formatted texts: letters, quests, briefings...

But, let's hear about others opinions as well.

15
Feature requests / New class for SFML2: TextArea.
« on: December 18, 2009, 05:20:23 pm »
TextArea class:

One thing which is missing in SFML for me is more advanced text renderer which will be used for large, formatted and styled strings. They will use for example HTML-like style formatting because it's quite common and simple.

I've written small sample today which render justified text in selected area. I know it should inherit sf::Drawable, render to texture for better performance, support more functions etc. but I can do it later.

My implementation:
main.cpp (for test) - http://paste-it.net/public/v157f0e/
TextArea.h - http://paste-it.net/public/g53e138/
TextArea.cpp - http://paste-it.net/public/td62458/

How it looks like:


What do you think about that idea?

Edit: Now I see this topic should be in Feature Request.

Pages: [1] 2