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.


Topics - dkaip

Pages: [1]
1
Graphics / I am tryin an array and i can not make it works ....
« on: March 12, 2010, 06:39:43 pm »
sf::Text  sIDs[4];
sIDs[0]=L"Hello you..."; // it dont work.

Also ...

sf::Text  sIDs[]={L"hello", L"you"}; // dont work.

How i must make an array of Text?

2
Window / About ctrl + Left arrow
« on: March 12, 2010, 11:36:19 am »
I am tryin in events to take the ctrl+left arrow event. First press ctrl, then left  key.
How i can take this event?

3
General / How i can take a substring?
« on: March 11, 2010, 10:51:47 am »
Hello.
I am looking for new_text=text.substr(from, number of chars ...)

Is there a such function?

4
Graphics / How can i take the shape in image and save?
« on: February 24, 2010, 08:05:30 pm »
Hello. I have a face object. How can i take the shape in image and give to disk?
Thank's
Jim

Code: [Select]

    FT_Library library; /* handle to library */
    FT_Face face; /* handle to face object */
    FT_Error  error;
    error = FT_Init_FreeType(&library);
    error = FT_New_Face( library,"arial.ttf", 0, &face );
    error = FT_Set_Char_Size( face, /* handle to face object */  0, /* char_width in 1/64th of points */  16*64, /* char_height in 1/64th of points */  300, /* horizontal device resolution */  300 ); /* vertical device resolution */
    error = FT_Set_Pixel_Sizes( face, /* handle to face object */  0, /* pixel_width */  16 ); /* pixel_height */
    int glyph_index = FT_Get_Char_Index( face, 0x0039);
    error = FT_Load_Glyph( face,glyph_index,FT_LOAD_NO_BITMAP);
    error = FT_Render_Glyph(face->glyph,FT_RENDER_MODE_MONO);
    FT_GlyphSlot slot = face->glyph; /* a small shortcut */

5
Graphics / compilling SFML2 with CodeBlocks
« on: February 18, 2010, 09:42:40 am »
Working in XP in a new installation of codeblocks, i am trying to compille SFML2.
Opening SFML workspace, and compilling, compiller says... and nothing ...

Linking console executable: ..\..\bin\ftp-d.exe
mingw32-g++.exe: ..\..\..\lib\mingw\libsfml-network-s-d.a: No such file or directory
mingw32-g++.exe: ..\..\..\lib\mingw\libsfml-system-s-d.a: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

What i have wrong?
Thank's
Jim

6
Graphics / How i can see Greek text?
« on: February 13, 2010, 09:07:23 am »
Hello. In code i have Greek language, arial have Greeks, but i can not see the real text.
How i can do that?
Thank's
Jim

Code: [Select]
   if (!MyFont.LoadFromFile("arial.ttf", 50))
        return EXIT_FAILURE;
// Create a graphical string
    sf::String Hello;
    Hello.SetText("Hello !\n γεια χαρά?");
    Hello.SetFont(MyFont);
    Hello.SetColor(sf::Color(0, 128, 128));
    Hello.SetPosition(100.f, 100.f);
    Hello.SetRotation(15.f);
    Hello.SetSize(50.f);

7
Graphics / I whant to open a ttf file from a directory ...
« on: January 30, 2010, 10:11:35 am »
Hello. I whant to open a ttf file from a directory and represent same chars.
First i must load ttf file. But compiler(win xp, codeblocks, gcc) says ...

What i wrong?
Thank's
Jim


obj\Debug\main.o||In function `main':|
C:\TMP\14\main.cpp|31|undefined reference to `__imp___ZN2sf4FontC1Ev'|
obj\Debug\main.o||In function `_ZNSt8_Rb_treeIPN2sf11ResourcePtrINS0_4FontEEES4_St9_IdentityIS4_ESt4lessIS4_ESaIS4_EE11_M_put_nodeEPSt13_Rb_tree_nodeIS4_E':|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\bits\stl_construct.h:(.text$_ZN2sf4FontD1Ev[sf::Font::~Font()]+0x6d)||undefined reference to `__imp___ZN2sf5ImageD1Ev'|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\bits\stl_construct.h:(.text$_ZN2sf4FontD1Ev[sf::Font::~Font()]+0x8c)||undefined reference to `__imp___ZN2sf5ImageD1Ev'|
||=== Build finished: 3 errors, 0 warnings ===|
 

Code: [Select]
#include <SFML/System.hpp>
#include <SFML/graphics.hpp>
#include <iostream>
#include <fstream>

//return a std::string copy (not reference) and pass a const-reference
std::string OpenFile( const std::string& filename )
{
    std::ifstream file(filename.c_str(), std::ios::binary | std::ios::ate );
    file.seekg( 0, std::ios::end );
    int length; // initialize length
    length = file.tellg( );
    file.seekg( 0, std::ios::beg );
    char* buffer = new char[ length ];
    file.read( buffer, length );
    file.close( );
    std::string encrypted = buffer;
    delete buffer;
    return encrypted;
}


int main()
{
    sf::Font font;
    std::string file = OpenFile( "myl.ttf" );
    font.LoadFromMemory( file.c_str( ), file.length( ) );


   return 0;
}
[/code]

Pages: [1]
anything