delete button texturized but still at incorrect position
This commit is contained in:
@@ -8,18 +8,18 @@ LDLIBS := -lraylib -lasound -llibremidi -pthread
|
||||
LDFLAGS := -Llib -L/usr/lib -L/usr/local/lib
|
||||
|
||||
SRCS := $(wildcard src/*.cpp)
|
||||
HDRS := $(wildcard src/*.h)
|
||||
OBJECTS := $(patsubst src/%.cpp,build/%.o, $(SRCS))
|
||||
DEPENDS := $(patsubst src/%.cpp,build/%.d, $(SRCS))
|
||||
|
||||
viseq: $(OBJECTS)
|
||||
$(CXX) $(OBJECTS) -o $@ $(LDFLAGS) $(LDLIBS)
|
||||
|
||||
$(OBJECTS): build/%.o : src/%.cpp
|
||||
@mkdir -p build
|
||||
$(CXX) -c $< -o $@ $(CXXFLAGS) $(CXXINC)
|
||||
-include $(DEPENDS)
|
||||
|
||||
src/%.cpp: $HDRS
|
||||
touch $@
|
||||
#$(OBJECTS): build/%.o : src/%.cpp
|
||||
build/%.o: src/%.cpp Makefile
|
||||
@mkdir -p build
|
||||
$(CXX) -c $< -o $@ $(CXXFLAGS) $(CXXINC) -MMD -MP
|
||||
|
||||
clean:
|
||||
rm -f build/*
|
||||
|
||||
+2
-1
@@ -14,8 +14,9 @@ inline bool ViButton(Vec2Df mp, float x, float y, float radius, Color color){
|
||||
|
||||
inline bool ViTexButton(Vec2Df mp, Vec2Df position, float rotation, float radius, Texture2D tex, Color color){
|
||||
float scale = (radius*2.0f) / (float)tex.width;
|
||||
Vec2Df center_pos = position - Vec2Df((tex.width*scale)/1.0f * sin(rotation), (tex.height*scale)/1.0f * cos(rotation));
|
||||
Vec2Df center_pos = position - Vec2Df((tex.width*scale) / 2.0f, (tex.height*scale) / 2.0f).rotate(rotation);
|
||||
DrawTextureEx(tex, center_pos, rotation, scale, color);
|
||||
|
||||
return (Vector2Distance(mp, position) < radius && IsMouseButtonPressed(MOUSE_BUTTON_LEFT));
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,10 @@ namespace VISEQ::VMATH{
|
||||
return Vec2D(-y, x);
|
||||
};
|
||||
|
||||
Vec2D rotate(float deg){
|
||||
return Vec2D(cos(deg*DEG2RAD) * x, sin(deg*DEG2RAD) * y);
|
||||
};
|
||||
|
||||
Vec2D norm() { return *this / length();};
|
||||
|
||||
Vec2D center(Vec2D v){
|
||||
|
||||
Reference in New Issue
Block a user