sfml

Xcode 11.2.1 - Command CodeSign failed with a nonzero exit code

↘锁芯ラ 提交于 2020-02-05 04:04:48
问题 I'm working on a SFML app for macOS with the latest Xcode version. I got a "Command CodeSign failed with a nonzero exit code" error when it tries to sign the SFML frameworks. I added these under "Link Binary with Libraries" and "Copy Files" in Target, under Build Phases. Before, I was working with my local frameworks under /Library/Frameworks , and it was working very well. Now I need to create an archive .app . I've tried a lot of things seen on other posts here (like lock and unlock my

SFML How can made correct collision bullet to ConvexShape polygon asteroid?obs:(in code before work with CircleShape)

三世轮回 提交于 2020-01-25 07:00:30
问题 [![enter image description here][1]][1]I just trying working on SFML code of asteroid game where collision bullet is checked with asteroid CircleShape by radius.I just changed shape to ConvexShape but cant find solution for made correct collision between bullet vector with Asteroid vector ConvexShape.Radius not work correctly. I go put a original code from asteroid.cpp bullet.cpp and level.cpp this last where ocurr conditional for kill bullet and broke or kill asteroid by distance of radius

Can't get real path for source - Xcode, SFML, C++

江枫思渺然 提交于 2020-01-22 16:32:05
问题 I am new to SFML, and followed SFML & Xcode tutorials for SFML 2.5 to try to get a basic program build and run. After copying the content of Frameworks to /Library/Frameworks and content of extlibs to /Library/Frameworks , and the Xcode templates, I was able to create a sample app via Xcode using the SFML App template. When I tried to build it, it failed with the following error: Any idea what I did wrong? Help is much appreciated! 回答1: Seems like a post build script is pointing to incorrect

SFML texture usage issue

£可爱£侵袭症+ 提交于 2020-01-21 19:17:50
问题 I want to make a tilemap but when I run this code, the tiles becomes white, the texture has a problem. I know it that from the sf::Texture reference here says that the texture must exist in order to that the sprite can use it. But I dont know how to make it possible. Here's the code: class Tile { private: sf::Sprite sprite; sf::Texture tex; public: Tile(int x, int y, sf::Texture tex) { this->tex = tex; this->sprite.setTexture(this->tex); this->sprite.setPosition(x, y); } void render(sf:

Mouse position with screen scrolling in SFML

坚强是说给别人听的谎言 提交于 2020-01-21 06:17:27
问题 Im trying to create a block placement with snap to grid. Everything is working, and in my head this should update the position of the mouse relative to the window each frame right? sf::Vector2i position = sf::Mouse::getPosition(window.mywindow); //get position int xSnap = (position.x / gridWidth) * gridWidth; int ySnap = (position.y / gridHeight) * gridHeight; But i also have screen scrolling using if (player.playerSprite.getPosition().x + 16 > screenDimensions.x / 2) position.x = player

Mouse position with screen scrolling in SFML

霸气de小男生 提交于 2020-01-21 06:13:56
问题 Im trying to create a block placement with snap to grid. Everything is working, and in my head this should update the position of the mouse relative to the window each frame right? sf::Vector2i position = sf::Mouse::getPosition(window.mywindow); //get position int xSnap = (position.x / gridWidth) * gridWidth; int ySnap = (position.y / gridHeight) * gridHeight; But i also have screen scrolling using if (player.playerSprite.getPosition().x + 16 > screenDimensions.x / 2) position.x = player

SFML Bounding Box Collision Detection

故事扮演 提交于 2020-01-13 18:55:16
问题 I am trying to write a very basic game for my first SFML project. Its a robot with a jointed arm that will be able to pop balloons with his hand only. The problem I am having is that when checking to see if the pincer sprite intersects with the balloon sprite , it returns true all the time, regardless of the placement of the balloon or the robot pincer. I am using transform to place the various parts of the robot arm, and this is whats causing the problem I think, but I don't know why. I have

SFML getGlobalBounds( ).intersect(getGlobalBounds( ) not Working

有些话、适合烂在心里 提交于 2020-01-07 09:36:06
问题 I just try got collsion from shipshape and asteroidshape but getGlobalBounds nothing happning.Im doing anything wrong? please help me. In Spaceship.hpp have a bool function.Very strange but the i need create any variable for reference to getGlobalBounds? I just put a code here from Spaceship.cpp for clarify. Spaceship.hpp ..... class Spaceship: public sf::Drawable, public sf::Transformable { ...... public: bool shipcollisionAsteroid(sf::ConvexShape shapeship, sf::ConvexShape shape); ....... .

SFML with Pointers. Image with vector and shared_ptr not showing

家住魔仙堡 提交于 2020-01-07 08:26:21
问题 The problem with the image output. If you directly use class 'picture', then everything is fine. If you use the class 'menu', then the image is not displayed. Source.cpp — working code using the class 'picture' directly #include <SFML/Graphics.hpp> #include <SFML/Audio.hpp> #include <windows.h> #include <conio.h> #include "Menu.h" int main() { sf::RenderWindow window(sf::VideoMode(960, 540), "Programmer Simulator", sf::Style::Close | sf::Style::Titlebar /*sf::Style::Fullscreen*/); sf::Image

Problems loading resources from function C++/SFML

一世执手 提交于 2020-01-07 07:28:28
问题 I have a stucture that I use to declare Textures, Sprites, Music, Fonts, Sounds, etc in a header. I then use a corresponding .cpp file to set said textures to their corresponding sprites, and so on. I have created the struct object in main, and called the function. But When I build my program, I get a million "undeclared identifier" errors. What am I doing wrong? Here's my code: resources.h: #ifndef __SFML__resources__ #define __SFML__resources__ #include "SFML/Audio.hpp" #include "SFML