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

Pages: [1]
1
Python / Re: Problem with getting fps
« on: September 05, 2012, 11:26:35 pm »
 :) no i would use fraps, thank you

2
Python / Re: Problem with getting fps
« on: September 05, 2012, 10:58:14 pm »
yes, i don't write in example type conversion, but why i get zero? maybe i must do anything else? How get fps?

3
Python / Re: Problem with getting fps
« on: September 05, 2012, 10:52:32 pm »
i know that and i know reason of problem i try to conversion types, not helped

4
Python / Problem with getting fps
« on: September 05, 2012, 09:04:02 pm »
I try to get fps by this way:
self.FPS = 1.0 / self.window.GetFrameTime(), but get ZeroDivisionError: float division, so how get fps

5
SFML projects / Re: TGUI: a c++ GUI for SFML (with Form Builder)
« on: August 26, 2012, 07:55:31 pm »
thank you? it work. Did i can use you lib v 0.5 in SFML v 2.0 RC?

6
SFML projects / Re: TGUI: a c++ GUI for SFML (with Form Builder)
« on: August 26, 2012, 07:13:19 pm »
Hello? I make my own level manager by our library "TGUI". So i make objects in this way:
void CreateEditBox(tgui::Window &window, tgui::EditBox *editbox, int x, int y, string value, int w=225, int h=20)
{
    editbox = window.addEditBox();
    editbox->load("objects/EditBox/Black");
    editbox->setBorders(4, 2, 2, 4);
    editbox->setPosition(x, y);
    editbox->setText(value);
    editbox->setSize(w, h);
}
so  in loop of tgui's events i want to get Text of edit box. How i can do it? if i use function EditBox->getText()? i get error "segmentation fault".

7
General / Re: box2d
« on: August 22, 2012, 11:17:04 am »
Thanks :)

8
General / Re: box2d
« on: August 22, 2012, 11:00:22 am »
So how much pixels in meter?

9
General / Re: box2d
« on: August 21, 2012, 12:02:53 pm »
#include <SFML/Graphics.hpp>
#include <Box2D/Box2D.h>
#include <iostream>

using namespace std;

const float M = 64.0;
const float P = 1.0/64.0;

int main()
{
    sf::RenderWindow Window(sf::VideoMode(800, 600, 32), "Test");
    // &#1089;&#1086;&#1079;&#1076;&#1072;&#1077;&#1084; &#1084;&#1080;&#1088;
    b2Vec2 gravity(0.0, 9.8);
    bool sleep = true;
    b2World world(gravity, sleep);

    // &#1089;&#1086;&#1079;&#1076;&#1072;&#1077;&#1084; &#1092;&#1080;&#1079;&#1080;&#1095;&#1077;&#1089;&#1082;&#1080;&#1081; &#1086;&#1073;&#1098;&#1077;&#1082;&#1090;
    b2BodyDef bodydef;
    bodydef.type = b2_dynamicBody;
    // &#1086;&#1087;&#1088;&#1077;&#1076;&#1077;&#1083;&#1103;&#1077;&#1084; &#1077;&#1075;&#1086; &#1082;&#1072;&#1082; &#1089;&#1090;&#1072;&#1090;&#1080;&#1095;&#1077;&#1089;&#1082;&#1080;&#1081;
    bodydef.position.Set(0,0);
    bodydef.angle = 0;
    // cjplftv &#1089;&#1072;&#1084; &#1086;&#1073;&#1098;&#1077;&#1082;&#1090;
    b2Body* body = world.CreateBody(&bodydef);
    // &#1089;&#1086;&#1079;&#1076;&#1072;&#1077;&#1084; &#1087;&#1086;&#1083;&#1080;&#1075;&#1086;&#1085; &#1080; &#1082;&#1088;&#1077;&#1087;&#1083;&#1077;&#1085;&#1080;&#1077;
    b2PolygonShape polygonShape;
    polygonShape.SetAsBox(64/2*P, 64/2*P);
    b2FixtureDef fixture;
    fixture.density = 0.5;
    fixture.friction = 0.7;
    fixture.shape = &polygonShape;
    body->CreateFixture(&fixture);
    //body->GetWorldPoint( b2Vec2(0,0) );
    // &#1089;&#1086;&#1079;&#1076;&#1072;&#1077;&#1084; &#1090;&#1077;&#1082;&#1089;&#1090;&#1091;&#1088;&#1091;
    sf::Texture texture;
    texture.loadFromFile("block.png");
    sf::Sprite sprite(texture);

    while (Window.isOpen())
    {
        Window.clear();
        world.Step(1/60, 6, 2);

        b2Vec2 bodyPos = body->GetPosition();
        b2Vec2 bodySize = b2Vec2(64*P, 64*P);
        sprite.setPosition(bodyPos.x - bodySize.x, bodyPos.y - bodySize.y);


        cout << "(" << body->GetPosition().x << ";" << body->GetPosition().y << ")" << endl;
        Window.draw(sprite);
        Window.display();
    }
    return 0;
}
 
why my body don't fly down? please help

10
General / Re: box2d
« on: August 21, 2012, 11:59:32 am »
what is bodySize? Is b2PolygonShape size?

11
General / Re: box2d
« on: August 21, 2012, 09:18:53 am »
Thanks for your answers... I use sfml 2.0 and box2d 2.1.2. I read documeantation of sfml 2.0 and not found function of set center of sprite.
how this function is named in sfml 2.0? How many pixels per meter? 64 or 32?

12
General / box2d
« on: August 15, 2012, 01:09:37 pm »
Please give me example how work with him in sfml with sprites

13
General / Help with problem
« on: August 13, 2012, 07:37:39 pm »
When i compile my project, i get this "symbol lookup error: /usr/local/lib/libsfml-audio.so.1.6: undefined symbol: _ZTIN2sf6ThreadE"
How to solve this problem?
Ubuntu 12.04 g++ sfml 1.6

Pages: [1]