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 - Sparticle

Pages: [1]
1
Graphics / Re: Need some help with primitives please!!!
« on: March 13, 2014, 10:57:08 am »
Keep the original alpha, just replace RGB channels.

Silly Me!!
Should of realized to keep the original alpha channel ::)



Thanks.

2
Graphics / Re: Need some help with primitives please!!!
« on: March 12, 2014, 11:41:59 am »
It's been a while since my last post as I've been away .
Anyway, I managed to update the fonts texture with one of my own. I tried the Texture.update() function but it also replaces the transparent pixels too.
Instead I just copied the textures image to another, loop through the array checking for none transparent Pixels, then replacing
them from my own.
The problem is now, as you can see, the textured text is not crisp and smooth like the normal one.
Thanks.

3
Graphics / Re: Need some help with primitives please!!!
« on: February 08, 2014, 02:10:14 pm »
If the replacement pixels are available as a simple pixel array, then use this overload of Texture::update.

Thanks, will try it out.

4
Graphics / Re: Need some help with primitives please!!!
« on: February 07, 2014, 10:46:23 am »
Ok, so that should be easy to do if you have the texture and area to modify. What's your problem exactly?

Thanks again.

The problem is figuring out how fill the glyph's contained in the copied texture with a different fill from another texture.
Is there an easy way to do this?

5
Graphics / Re: Need some help with primitives please!!!
« on: February 07, 2014, 09:13:23 am »
You can't directly change the contents (glyph, texture) of a sf::Font. You must write your own custom font class.

Thanks for the reply.

I understand that you can't directly change the contents of glyph's and the fonts texture.
My idea was to copy the fonts texture containing all the glyph's needed in to my own texture.
Then somehow change the characters contained in it with a different fill from another texture.
A bit like a stencil.

6
Graphics / Re: Need some help with primitives please!!!
« on: February 07, 2014, 04:35:18 am »
I'm fairly certain they have an explanation of how to do this in the SFML tutorial section under "Texts and fonts"(http://www.sfml-dev.org/tutorials/2.1/graphics-text.php). Unless you need to do something different, of course.

I've already looked at this tutorial.
It only tells you how to obtain the glyph's texture and coordinates, it doesn't tell you how to change the actual glyph's texture.

For example:-

sf::Font f;
f.loadFromfile("font.ttf");
sf::Texture t = f.getTexture(50);
sf::Glyph g = f.getGlyph('a',50,sf::Text::Bold);

I now have the glyph 'a' texture and coordinates.
What i want to know is how to change the glyph's texture to say, the texture of a brick wall or something else.

Thanks.

7
Graphics / Re: Need some help with primitives please!!!
« on: February 07, 2014, 03:56:16 am »
Thanks will check it out now.

8
Graphics / Need some help with primitives please!!!
« on: February 07, 2014, 03:39:32 am »
Hi all,

I'm creating a module which manipulates text using sf::vertices. So far I can create nice gradients, cycle colors and scroll text etc but want to know if there is a way I can apply a different texture to the text' s glyph's and how to go about doing that.

9
General / Newbie Help
« on: August 27, 2009, 08:14:12 pm »
Hi,  Im trying to compile the "graphics-Sprite.cpp" example from the tutorial section on the main website but keep getting these link errors:-

1>------ Rebuild All started: Project: 3, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project '3', configuration 'Debug|Win32'
1>Compiling...
1>graphics-sprite.cpp
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>Linking...
1>graphics-sprite.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Window::Display(void)" (__imp_?Display@Window@sf@@QAEXXZ) referenced in function _main
1>graphics-sprite.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall sf::Input::IsKeyDown(enum sf::Key::Code)const " (__imp_?IsKeyDown@Input@sf@@QBE_NW4Code@Key@2@@Z) referenced in function _main
1>graphics-sprite.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::Input const & __thiscall sf::Window::GetInput(void)const " (__imp_?GetInput@Window@sf@@QBEABVInput@2@XZ) referenced in function _main
1>graphics-sprite.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: float __thiscall sf::Window::GetFrameTime(void)const " (__imp_?GetFrameTime@Window@sf@@QBEMXZ) referenced in function _main
1>graphics-sprite.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Window::Close(void)" (__imp_?Close@Window@sf@@QAEXXZ) referenced in function _main
1>graphics-sprite.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall sf::Window::GetEvent(class sf::Event &)" (__imp_?GetEvent@Window@sf@@QAE_NAAVEvent@2@@Z) referenced in function _main
1>graphics-sprite.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall sf::Window::IsOpened(void)const " (__imp_?IsOpened@Window@sf@@QBE_NXZ) referenced in function _main
1>graphics-sprite.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (__imp_??0VideoMode@sf@@QAE@III@Z) referenced in function _main
1>C:\Users\Dean\Documents\Visual Studio 2008\Projects\sfm\Debug\3.exe : fatal error LNK1120: 8 unresolved externals
1>Build log was saved at "file://c:\Users\Dean\Documents\Visual Studio 2008\Projects\sfm\3\Debug\BuildLog.htm"
1>3 - 9 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

My configuration settings are for debug and Im linking with "sfml-graphics-d.lib" in the linker/input tab in visualC++ 2008.
The first couple of tutorials link fine but im stuck on this one.
I created the project as a Win32Console project for my soloution.
Please bear in mind im a novice at programming and new to SFML so please keep any replies as simple as possible
I was recommended to use it rather than a game engine I have put together with bits of code from various books.

Thanks.

Pages: [1]