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

Pages: [1] 2
1
Python / Re: sf.Text adding a symbol before text
« on: December 19, 2015, 04:54:35 pm »
Yes, i get system font, this font support my languafe, i screen  view frontforge

I would be grateful for a solution to my problem.

Still, I can say that in front of me managed to forge change addresses of the Russian into English, but it does not solve my problem.

2
Python / Re: sf.Text adding a symbol before text
« on: December 19, 2015, 08:46:56 am »
I have a problem problems with non-ASCII characters(russian languge). I use
#!/usr/bin/python
# -*- encoding: utf-8 -*-
import sfml as sf
import json
class draws:
    def __init__(self):
        with open('setting.json') as data_file:    
            setting = json.load(data_file)
        print
        self.window = sf.RenderWindow(sf.VideoMode(setting['window_width'],
                                                   setting['window_height']),
                                                   setting['title'])
        self.run()#bot
    def run(self):
        font = sf.Font.from_file("arial.ttf")
        text = sf.Text("Русский текст", font, 16)#this error string
        while self.window.is_open:
            for event in self.window.events:
                if type(event) is sf.CloseEvent:
                    self.window.close()
            self.window.clear(sf.Color.BLUE)
            self.window.draw(text)
            self.window.display()
if __name__ == "__main__":
    Tree = draws()
but i get error:
Console error: UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)

I use unicode:
text = sf.Text(u"Русский текст", font, 16)#this error string
 
exelent, but wrong drawing literals. image error:


I use cp1253(russian decode)
text = sf.Text(u"Русский текст".decode('cp1253'), font, 16)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-6: ordin al not in range(128)

i use python 2.7 and pysfml 2.2 in exe installer
English text exelent draw. I now not see as this job.
You redactor replacement code, this link pastebin:
http://pastebin.com/nw04s6Ca
http://pastebin.com/Tyfae3RC

3
You must build sfml from sourse. I build from source and runung, no warning. This is error from old version gcc.

4
General / Re: Change hardware cursor?
« on: July 19, 2015, 10:55:50 am »
You must using winapi and unsubscribe from standart cursor. Next step create sprite end draw his on coordinate mouse.

5
General / Re: No compilу sfml 2.3.1 for MinGW 4.4.7
« on: July 18, 2015, 10:33:00 pm »
Thank you, from the left to find the remove the old version. Or reinstall the system with XP on win8.1 and try it again. If you fail, I will unsubscribe on their actions.
----------------------------------------------------------------
Hello guys. I install win8 and load MinGW, nex i rebuild cmake and make command mingw-make. Well done!!!
http://i.imgur.com/WCLQnZB.png

6
General / Re: No compilу sfml 2.3.1 for MinGW 4.4.7
« on: July 18, 2015, 10:18:39 pm »
I installed MinGW from the official website(2:00 hourse ago) ... I do not know what happened, but I also use the search in Google, I try to place your bid.
-----------------------------------------
It'is my MinGW:
http://i.imgur.com/xWD6NTe.png
and
http://i.imgur.com/NMZCAEF.png

7
General / No compilу sfml 2.3.1 for MinGW 4.4.7
« on: July 18, 2015, 09:54:16 pm »
Text error when using the mingw32-make:
Linking CXX shared library ..\..\..\lib\sfml-graphics-2.dll
Creating library file: ..\..\..\lib\libsfml-graphics.a
C:/projectHakasia/SFML-2.3.1/extlibs/libs-mingw/x86/libfreetype.a(cff.c.obj):cff
.c:(.text+0x93eb): undefined reference to `__chkstk_ms'
collect2: ld returned 1 exit status
src\SFML\Graphics\CMakeFiles\sfml-graphics.dir\build.make:819: recipe for target
 'lib/sfml-graphics-2.dll' failed
mingw32-make[2]: *** [lib/sfml-graphics-2.dll] Error 1
CMakeFiles\Makefile2:305: recipe for target 'src/SFML/Graphics/CMakeFiles/sfml-g
raphics.dir/all' failed
mingw32-make[1]: *** [src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/all] Error
2
Makefile:115: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

8
General / Beautiful demoscene
« on: September 17, 2014, 01:50:19 pm »
Hi, I am a fan of SFML and therefore opened its Russian lessons on it. Do beautiful examples demoscene on sfml? Need to demonstrate the potential of sfml page.
If interested, then here is my site: http://kfni.ho.ua/sfml.html :)

9
General / Compilling sfml in /Mtd
« on: August 27, 2014, 12:55:51 pm »
Hi, as compilling sfml in Mtd(Multi-threader )?
main.obj : error LNK2005: "public: __thiscall std::locale::locale(void)" (??0locale@std@@QAE@XZ) уже определен в msvcprtd.lib(MSVCP90D.dll)
1>main.obj : error LNK2005: "public: __thiscall std::locale::~locale(void)" (??1locale@std@@QAE@XZ) уже определен в msvcprtd.lib(MSVCP90D.dll)

10
Graphics / Re: No smooth RenderTexture
« on: June 16, 2014, 11:00:04 pm »
here and so you can see that the font is not smoothed. I create a function to draw text as standard features of the framework for drawing text slow. Just tell me how to smooth it.
#include <iostream>
#include <string>
using namespace std;
//текст
#include <SFML/Graphics.hpp>

sf::RenderTexture drawtext;
sf::Sprite s_drawtext;
sf::Texture t_hero;
sf::Texture t_smallfont;
void drawstring(string massive,int x, int y){

   int wight,//ширина спрайта в который рисуется текст
      height,//высота
      mass_size;//нужен для циклов обработки



//install texture
   mass_size = massive.size();//количество букв в массиве
   wight = 64*massive.size();//ширина текстуры
   height = 600;//высота
   drawtext.create(wight, height);//создаем текстуру в которую будем рендерить спрайты
   sf::Sprite textmass[200];//создать массив букв

   //присвоить текстурку шрифта всем 200 спрайтам
   for(int counter2 = 0; counter2 < mass_size; counter2 ++ )
   {
      textmass[counter2].setTexture(t_hero);
   }

   //присвоить каждой букве текстуру
   for (int counter = 0; counter < mass_size; counter ++ ){

         #include "key.h"//таблица букв
   }
   //что-то тут рисует в текстуру
   for (int counter = 0; counter < mass_size; counter ++ ){
      textmass[counter].setPosition(50*counter,0);

      drawtext.draw(textmass[counter]);
      }
   drawtext.setSmooth(true);
   drawtext.display();

}
int vrom = 150;
int main(){
   sf::RenderWindow window(sf::VideoMode(800, 600), "Kfni.ho.ua load image");

   t_hero.loadFromFile("C:/resources/font.png");
   t_smallfont.loadFromFile("C:/resources/small_font.png");

   sf::Sprite s_hero;
   s_hero.setTexture(t_smallfont);
   s_hero.setPosition(400,300);

   s_hero.setTextureRect(sf::IntRect(0, 0, 21, 21));

   drawstring("я люблю программить на си мне это нрав вообще и я всех лю",15,15);

   s_drawtext.setScale(0.2,0.2);
   while (window.isOpen())
   {
      sf::Event event;
      while (window.pollEvent(event))
      {
         if (event.type == sf::Event::Closed)
            window.close();
      }

      window.clear(sf::Color::White);
      window.draw(s_hero);

      s_drawtext.setTexture(drawtext.getTexture());
      
      window.draw(s_drawtext);
      window.display();
   }
   return 0;
}

11
Graphics / No smooth RenderTexture
« on: June 16, 2014, 09:14:00 pm »
sf::RenderTexture drawtext;
sf::Sprite s_drawtext;

s_drawtext.setScale(0.2,0.2);
...code..
while(1){

drawtext.setSmooth(true);
s_drawtext.setTexture(drawtext.getTexture());

}
No smooth!!!!

12
Graphics / Re: Dynamic light(shadow), as create?
« on: May 07, 2014, 09:57:08 pm »
Sorry to bother you, you can give sample?

Or how to implement lighting as there:


Or some simple lighting system. And my happiness will unlimited!
I use sfml 2.1


13
Graphics / Dynamic light(shadow), as create?
« on: May 07, 2014, 09:32:53 pm »



Light should move.
what tools are needed for this?
An example of what I want to get:

Only moving light areas must be many.

14
General / Re: Error in compilation test project VC8 c++
« on: February 17, 2014, 08:03:56 pm »
Ah yes, I understand what went wrong, but I do not write correctly comes winMain(). If you are prompted example of the work I would have been easier.

15
General / Re: Error in compilation test project VC8 c++
« on: February 17, 2014, 07:51:57 pm »
I read Google before creating threads.
Minor bugs I understand, but not those evil!!! >:(

Can screen create?

EXAMPLE Please enter the studio!!!

Or how to make that the console does not display when the program run

Pages: [1] 2
anything