Code Monkey home page Code Monkey logo

Comments (13)

kaoti avatar kaoti commented on June 15, 2024 1

Lol i didnt thought about that... and thats right, it works right now! thanks you!

from avo.

kaoti avatar kaoti commented on June 15, 2024 1

You inspired me to make one gui system myself!!! thanks you!

from avo.

avocadoboi avatar avocadoboi commented on June 15, 2024

That sounds weird, could you post a minimal example?

from avo.

kaoti avatar kaoti commented on June 15, 2024

Sure

image

from avo.

kaoti avatar kaoti commented on June 15, 2024

And this happens too, it disappears when its outside of some kind of container...
image

from avo.

avocadoboi avatar avocadoboi commented on June 15, 2024

I would suspect that the problem here is that you are not thinking about the coordinates as relative to the parent of the view. For example, if I write:

auto container = new AvoGUI::View(this);
container->setTopLeft(100);
container->setSize(300);

auto child = new AvoGUI::View(container);

Now child is positioned at (100, 100) relative to the GUI, because the default top-left coordinates are (0, 0).

from avo.

kaoti avatar kaoti commented on June 15, 2024

I would love to learn to use this library because its beautiful! you should do tutorials about this api, i think that people will like it

from avo.

avocadoboi avatar avocadoboi commented on June 15, 2024

I've thought about making some tutorial about it, thanks for the motivation! Will do when I have time.

from avo.

kaoti avatar kaoti commented on June 15, 2024

Or create a full documentation on it... will be amazin would be

from avo.

avocadoboi avatar avocadoboi commented on June 15, 2024

Yes, might make some kind of website with documentation when the API is final enough, still making some big changes sometimes...

Did you understand what the problem was with your positioning? When you write getBottom() or getCenterY(), those coordinates are absolute and not relative to the parent of the view you're positioning. Also remember that child views are clipped by their parent, so if a child is outside of its parent, it's invisible. Also you might consider removing the container view completely and directly attach the text field to the GUI.

from avo.

avocadoboi avatar avocadoboi commented on June 15, 2024

Nice!
What you would write to center a view within a container would be:

auto container = new View(this);
container->setSize(400, 300); // whatever

auto child = new View(container);
child->setCenter(container->getSize()/2.f);

// Now, if we move the container:
container->move(100, 200);
// The child will still be in the center of the container!

from avo.

kaoti avatar kaoti commented on June 15, 2024

Man, i admire you... wou wrote 26000 fucking c++ lines of code... its impressive, how much time did you spent in this project?

from avo.

avocadoboi avatar avocadoboi commented on June 15, 2024

Haha, it took a long time. The motivation has always been strong though, I made it because I was frustrated that there was no library that fit my "needs". When I first started programming, I made games with SFML. Then I started to make fun little JavaScript projects which I put on my website. I always wished I could make anything in c++, including those types of projects. I searched a lot for libraries but the best I could find was like Qt, which is GIANT and it's not fully open source. I wanted a clean library with a logical API that gives a lot of freedom and can be used to make graphical programs as good looking as what you can make with html, css and javascript. I also wanted the framework to hold for making large applications.

I'm still working towards that goal, mainly by just making stuff with it and thinking about how it could be designed differently to work more smoothly, etc.

from avo.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.