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

Pages: [1] 2
1
SFML projects / Unnamed Project: Top-Down 2D Game
« on: March 01, 2016, 04:19:21 am »
Currently the game are under development, uses Box2D for physics and 'TMX Parser Lib' for read 'tmx' maps (yep.. I use tiled map editor).

The map can be virtually 'infinite' (clipping and using quadtree), in this video I only spawn 7 A.I Players.. can see that the 'clipping' method doesn't looks bad...
For 'cars' A.I Players.. i'm currently using an a bad "A+ Pathfinding" implementation :S (need be reworked)... with Manhattan heuristic.
The lighting system it's very simple but works pretty good :) only use a sprite for create the spot light and a 'RenderTexture' for generate the lightmap.
For tile map rendering i'm using textures with size power of two and vertex array.
The Particle system is the same that i made for 'FingerShip' game... but with possibility for define light particles.




Cheers!
** Sry for my bad english :\

2
General / [Android] LoadFromFile (Not apk/internal asset)
« on: June 09, 2015, 06:32:53 am »
I see that Android ResourceStream implementation only works with Internal Assets... perhaps is best uses "FILE" against "Asset" and use "funopen" for get FILE handle... and try first to get a internal assets if it can't... try with 'normal' resource... or something like that :\

Or.. exists any method for load "external" assets??!?!!

*** In 2.3 i get a crash when try load a file that doesn't exists.
Code: [Select]
sf::Texture texture;
texture.loadFromFile("ssss");  <-- CRASH!


How i can help with Android branch?

Grettings!

3
General / [Android] Keyboard issues
« on: June 06, 2015, 04:34:28 pm »
Hi! i have a problem with keyboard... in some devices when i show the keyboard it get stuck... you can't type anything (or very laggy)... :\

Other... it's possible know when the user active the keyboard? It's possible show a only numbers keyboard?

Thx!


For show keyboard:
Code: [Select]
sf::Keyboard::setVirtualKeyboardVisible(true);
For get input:
Code: [Select]
    while (m_Window.isOpen() && !m_CloseApp)
    {
    // Events
        sf::Event event;
        while (m_Window.pollEvent(event))
        {
            if (event.type == sf::Event::TextEntered)
            {
            int ckey = static_cast<char>(event.text.unicode);
            if (m_pHotGUIEntity && m_pHotGUIEntity->getType() == CGUIEntity::EDITBOX && event.text.unicode < 128)
            {
            CEditBox *pEditBox = static_cast<CEditBox*>(m_pHotGUIEntity);
            pEditBox->onTextEntered(ckey);
            }
            }
        }
    }

4
Graphics / sf::Texture to sf::Image
« on: June 01, 2015, 07:02:37 pm »
HI! its possible get a sf::Image from a sf::Texture?? or best... its possible get the array of pixels of the texture without using sf::Image?

Thx!

5
General / [Android] Custom Native Activity
« on: December 01, 2014, 01:22:38 am »
Hi, its possible create a custom NativeActive?

Something like this...?

AndroidManifest.xml
Code: [Select]
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="es.redneboa.fingership"
    android:versionCode="12"
    android:versionName="2.5" >

<......................>

    <activity android:name=".FingerShipNative"
              android:label="@string/app_name"
              android:icon="@drawable/ic_launcher"
              android:configChanges="keyboardHidden|screenSize"
              android:screenOrientation="portrait">
       
        <meta-data android:name="android.app.lib_name" android:value="sfml-activity" />       
        <meta-data android:name="sfml.app.lib_name" android:value="fingership" />

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
       
    </activity>


FingerShipNative.java
Code: [Select]
package es.redneboa.fingership;

import android.app.NativeActivity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;

public class FingerShipNative extends NativeActivity {
    static final String TAG = "FingerShip";
   
    private static NativeActivity me = null;


    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle icicle)
    {
    AndroidUtils.showTooltipAlert(this, "Test...");
   
        super.onCreate(icicle);
        me = this;
    }
   
    public static void openURL(String url)
    {     
        Intent i = new Intent(Intent.ACTION_VIEW); 
        i.setData(Uri.parse(url));
        me.startActivity(i);
}
}

My Project:


I get this error:
Code: [Select]
12-01 01:17:54.086: E/AndroidRuntime(25324): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{es.redneboa.fingership/es.redneboa.fingership.FingerShipNative}: java.lang.ClassNotFoundException: Didn't find class "es.redneboa.fingership.FingerShipNative" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
Thx.

6
General / [Android] Google Play Game Integration Problem
« on: November 28, 2014, 09:39:51 pm »
Hi! i try to integrate GPG (Google Play Games) in my app... i downloaded gpg-sdk and setup it following these steps:

1. Copy "include" in to "sfml/include" installation
2. Copy "lib/c++/armeabi" in to "sfml/extlibs/lib/armeabi"
3. Modify "sfml/extlibs/Android.mk":
Code: [Select]
# GPG
include $(CLEAR_VARS)
LOCAL_MODULE := gpg
LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libgpg.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_STATIC_LIBRARY)

4. Modify the "Android.mk" of my project:
Code: [Select]
LOCAL_STATIC_LIBRARIES := gpg
LOCAL_SHARED_LIBRARIES := sfml-system
LOCAL_SHARED_LIBRARIES += sfml-window
LOCAL_SHARED_LIBRARIES += sfml-graphics
LOCAL_SHARED_LIBRARIES += sfml-audio
LOCAL_SHARED_LIBRARIES += sfml-network
LOCAL_WHOLE_STATIC_LIBRARIES := sfml-main

#Zlib
LOCAL_LDLIBS += -lz

All compile fine... but have execution errors.. the code:
Code: [Select]
gpg::AndroidPlatformConfiguration platform_configuration;
platform_configuration.SetActivity(((ANativeActivity*)m_pWindow->getNativeActivity())->clazz);
StateManager::InitServices(platform_configuration, nullptr, callback);

The error:
Code: [Select]
11-28 21:14:39.939: E/GamesNativeSDK(15545): A method from AndroidInitialization must be called for an AndroidPlatformConfiguration to be Valid.

Any know why happens this? thx :\

7
SFML projects / [Android] Teeworlds Map Editor (Online 2D Map Editor)
« on: November 26, 2014, 06:53:41 pm »
Hi! i present here my project... it's under development (more news: https://twmapeditor.wordpress.com)... this is a tool for map makers of Teeworlds game.

With this app you can create or modify teeworlds maps online or offline... it can open/write .map files, render maps, connecto to teeworlds servers,... and other map maker stuff. I needed modify the SFML API a bit for get "ANativeActivity" and know the default folder for save edited and downloaded maps.

The app uses the 'native' teeworlds network implementation. For use it you need run a modified teeworlds server called "mapper" for connect it from this app and edit map collaborative (Up to 16 clients).


8
SFML projects / [Android] FingerShip (The challenge of 15 meters)
« on: August 24, 2014, 06:37:43 am »
Hi ppl! I show this little game around here ... it's my first game for mobile: P

The game consists of traveling 15 yards without dying and get the highest score possible.

Currently in beta, so strangers can happen ...

Download: https://play.google.com/store/apps/details?id=es.redneboa.fingership

Preview:


--
Sry for my bad english.

9
General / [Android] How to vibrate the device?
« on: August 15, 2014, 09:05:53 pm »
Hi again...

How to vibrate the device or get the native activity?

thx!

10
General / Setup Android project
« on: April 18, 2014, 04:49:27 pm »
Hi! sry for this noob question.. but.... How i can use SFML-ios_and_android???

I try go to example android folder and run "ndk-build" but it says that can't found sfml module..
I try put SFML source in source folder of ndk... and run again "ndk-build" and it says:
Code: [Select]
C:\Programacion\C++\Android\SFML-ios_and_android\examples\android>ndk-build
Android NDK: WARNING: APP_PLATFORM android-17 is larger than android:minSdkVersi
on 9 in ./AndroidManifest.xml
Android NDK: ERROR:C:/Programacion/C++/Android/android-ndk/sources/sfml/Android.
mk:sfml-system: LOCAL_SRC_FILES points to a missing file
Android NDK: Check that C:/Programacion/C++/Android/android-ndk/sources/sfml/lib
/armeabi/libsfml-system.so exists  or that its path is correct
C:/Programacion/C++/Android/android-ndk/build/core/prebuilt-library.mk:45: *** A
ndroid NDK: Aborting    .  Stop.


Umm how setup a projecto for compile them??? thx!!

P.S: Sry for my bad english :(

11
General / OpenGL load texture from Thread
« on: September 14, 2013, 07:00:09 pm »
Hi, i can't use search function... says "DATABASE ERROR".

I'm trying load texture from a thread, but Main thread can't use textures....

Main Thread:
Code: [Select]
    hdc = GetDC(m_pPictureSelector->getSystemHandle());
    mainContext = wglGetCurrentContext();
    loaderContext = wglCreateContext(hdc);

    wglShareLists(loaderContext, mainContext);
    sf::Thread thread(&LoadPictures, m_pPictureSelector);
    thread.launch();

Thread:
Code: [Select]
void LoadPictures(CPictureSelector *pPictureSel)
{
    wglMakeCurrent(hdc, loaderContext);
    pPictureSel->LoadPictures();
    wglMakeCurrent(NULL, NULL);
    wglDeleteContext(loaderContext);
}


Function that load Textures
Code: [Select]
int CPictureSelector::LoadTexture(const char *filepath)
{
    sf::Image img;
    if (!img.loadFromFile(filepath))
        return -1;

    m_vTextures.push_back(0);
    glGenTextures(1, &m_vTextures[m_vTextures.size()-1]);
    glBindTexture(GL_TEXTURE_2D, m_vTextures[m_vTextures.size()-1]);
    gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, img.getSize().x, img.getSize().y, GL_RGBA, GL_UNSIGNED_BYTE, img.getPixelsPtr());
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);

    return m_vTextures.size()-1;
}

What am I doing wrong? thx!

12
Audio / [SOLVED] I can't play music
« on: May 10, 2013, 06:25:48 pm »
Hi! I've never had problems playing sounds but with 2.0 yes.. xDD

Code: [Select]
    sf::Music musicIntro;
    if (musicIntro.openFromFile("sonidos/intro.ogg"))
    {
        //musicIntro.setPitch(1.0f);
        //musicIntro.setVolume(100);
        musicIntro.play();
    }

I try with .wav and .ogg... Can found the sound here: http://soundbible.com/1563-Pacman-Introduction-Music.html

P.S: SFML not show errors in console..
P.S 2: Sry for my bad english :d

-------------------

Yes... i know.... omg.... xDD

13
Graphics / sf::Sprite SetSubRect Fail
« on: May 18, 2012, 06:35:09 am »
Hi! i have one issue when i apply zoom and show sprites whit "SubRect" from image....

I use this to draw the sprite:
sf::Sprite SprTile;
SprTile.SetImage(*m_pMap->GetImage(pLayerTile->m_TexID));
SprTile.SetSubRect(sf::IntRect(TexX<<6, TexY<<6, (TexX<<6)+64, (TexY<<6)+64));
SprTile.Resize(32, 32);
SprTile.SetPosition(offsetX+pGroup->m_OffsetX+pLayerTile->m_OffsetX+(o<<5),offsetY+pGroup->m_OffsetY+pLayerTile->m_OffsetY+(u<<5));

m_pGUI->GetRenderWindow()->Draw(SprTile);
 

You can see the issue here:


What happens? thx!!

------------
P.S: Sry for my bad english :\

14
General / Keyboard keys
« on: April 13, 2012, 04:33:29 am »
Hi! i'm making a GUI and I need get keys code "Caps Lock" and all alphanumerics... is this possible?

Code: [Select]
            case EDITBOX:
            {
                CEditBox *pEditBox = static_cast<CEditBox*>(m_pFocusEnt);
                std::string CurrentText = pEditBox->GetText();
                int CharSelected = pEditBox->GetCharSelected();

                if (*pKeyPressed == sf::Key::A)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'A');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'a');
                }
                else if (*pKeyPressed == sf::Key::B)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'B');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'b');
                }
                else if (*pKeyPressed == sf::Key::C)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'C');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'c');
                }
                else if (*pKeyPressed == sf::Key::D)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'D');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'd');
                }
                else if (*pKeyPressed == sf::Key::E)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'E');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'e');
                }
                else if (*pKeyPressed == sf::Key::F)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'F');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'f');
                }
                else if (*pKeyPressed == sf::Key::G)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'G');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'g');
                }
                else if (*pKeyPressed == sf::Key::H)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'H');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'h');
                }
                else if (*pKeyPressed == sf::Key::I)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'I');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'i');
                }
                else if (*pKeyPressed == sf::Key::J)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'J');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'j');
                }
                else if (*pKeyPressed == sf::Key::K)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'K');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'k');
                }
                else if (*pKeyPressed == sf::Key::L)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'L');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'l');
                }
                else if (*pKeyPressed == sf::Key::M)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'M');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'm');
                }
                else if (*pKeyPressed == sf::Key::N)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'N');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'n');
                }
                else if (*pKeyPressed == sf::Key::O)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'O');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'o');
                }
                else if (*pKeyPressed == sf::Key::P)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'P');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'p');
                }
                else if (*pKeyPressed == sf::Key::Q)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'Q');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'q');
                }
                else if (*pKeyPressed == sf::Key::R)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'R');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'r');
                }
                else if (*pKeyPressed == sf::Key::S)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'S');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 's');
                }
                else if (*pKeyPressed == sf::Key::T)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'T');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 't');
                }
                else if (*pKeyPressed == sf::Key::U)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'U');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'u');
                }
                else if (*pKeyPressed == sf::Key::V)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'V');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'v');
                }
                else if (*pKeyPressed == sf::Key::W)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'W');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'w');
                }
                else if (*pKeyPressed == sf::Key::X)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'X');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'x');
                }
                else if (*pKeyPressed == sf::Key::Y)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'Y');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'y');
                }
                else if (*pKeyPressed == sf::Key::Z)
                {
                    if (GetRenderWindow()->GetInput().IsKeyDown(sf::Key::LShift) || GetRenderWindow()->GetInput().IsKeyDown(sf::Key::RShift))
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'Z');
                    else
                        CurrentText.insert(CurrentText.begin()+CharSelected, 'z');
                }
                else if (*pKeyPressed == sf::Key::Num0 || *pKeyPressed == sf::Key::Numpad0)
                    CurrentText.insert(CurrentText.begin()+CharSelected, '0');
                else if (*pKeyPressed == sf::Key::Num1 || *pKeyPressed == sf::Key::Numpad1)
                    CurrentText.insert(CurrentText.begin()+CharSelected, '1');
                else if (*pKeyPressed == sf::Key::Num2 || *pKeyPressed == sf::Key::Numpad2)
                    CurrentText.insert(CurrentText.begin()+CharSelected, '2');
                else if (*pKeyPressed == sf::Key::Num3 || *pKeyPressed == sf::Key::Numpad3)
                    CurrentText.insert(CurrentText.begin()+CharSelected, '3');
                else if (*pKeyPressed == sf::Key::Num4 || *pKeyPressed == sf::Key::Numpad4)
                    CurrentText.insert(CurrentText.begin()+CharSelected, '4');
                else if (*pKeyPressed == sf::Key::Num5 || *pKeyPressed == sf::Key::Numpad5)
                    CurrentText.insert(CurrentText.begin()+CharSelected, '5');
                else if (*pKeyPressed == sf::Key::Num6 || *pKeyPressed == sf::Key::Numpad6)
                    CurrentText.insert(CurrentText.begin()+CharSelected, '6');
                else if (*pKeyPressed == sf::Key::Num7 || *pKeyPressed == sf::Key::Numpad7)
                    CurrentText.insert(CurrentText.begin()+CharSelected, '7');
                else if (*pKeyPressed == sf::Key::Num8 || *pKeyPressed == sf::Key::Numpad8)
                    CurrentText.insert(CurrentText.begin()+CharSelected, '8');
                else if (*pKeyPressed == sf::Key::Num9 || *pKeyPressed == sf::Key::Numpad9)
                    CurrentText.insert(CurrentText.begin()+CharSelected, '9');
                else if (*pKeyPressed == sf::Key::Space)
                    CurrentText.insert(CurrentText.begin()+CharSelected, ' ');
                else if (*pKeyPressed == sf::Key::Back && CurrentText.size() > 0)
                {
                    std::string::iterator it = CurrentText.begin()+CharSelected-1;
                    if (it >= CurrentText.begin())
                        CurrentText.erase(it);
                }
                else if (*pKeyPressed == sf::Key::Delete && CurrentText.size() > 0)
                {
                    std::string::iterator it = CurrentText.begin()+CharSelected;
                    if (it < CurrentText.end())
                        CurrentText.erase(it);
                    pEditBox->SetCharSelected(CharSelected+1);
                }
                else if (*pKeyPressed == sf::Key::Left)
                {
                    int CurrentCharSel = pEditBox->GetCharSelected();
                    CurrentCharSel--;
                    pEditBox->SetCharSelected(CurrentCharSel);
                }
                else if (*pKeyPressed == sf::Key::Right)
                {
                    int CurrentCharSel = pEditBox->GetCharSelected();
                    CurrentCharSel++;
                    pEditBox->SetCharSelected(CurrentCharSel);
                }

                pEditBox->SetText(CurrentText.c_str());

            } break;



Download Demo: http://dl.dropbox.com/u/30566237/bin.rar

15
General discussions / Thx for make it!!
« on: September 30, 2010, 02:59:05 pm »
I just wanted to thank you the effort of all developers that enable SFML ... Thanks :)

Pages: [1] 2