Code Monkey home page Code Monkey logo

Comments (2)

SpicyMelonYT avatar SpicyMelonYT commented on May 20, 2024 1

Ah I see, that is totally ok and I will do what you said thank you! Plan b with asking that question was to get pointed in the right direction so thanks!

from pixelwindow.

Jallenbah avatar Jallenbah commented on May 20, 2024

Hi, glad you like it!

The PixelWindow repo is built on top of SFML.Net which is a .Net binding of SFML

In the Learn section of the official site you can see tutorials on how to do all sorts of things in SFML including input. Note that the tutorials use C++ as that is the language that the library is natively written in and available in, but the C# ends up being easy to figure out from their samples.

For an example of mouse input within a specific window, you can see an example of me using it in my Conway's Game of Life implementation in the HandleDrawingCells method within the GameOfLifeAppManager.cs file.

The PixelWindow system will give you a reference to the SFML RenderWindow in the OnLoad function. Store a copy of that in your app manager class when OnLoad runs, then you can use that to get the mouse pos relative to the window using

Mouse.GetPosition(_renderWindow);

There's also examples of key input in that game of life repo.

Hope this answers your question. I have no plans to add any kind of wrapper around the input to expose it within the PixelWindow class as there's a bunch of useful stuff that SFML exposes that you can use out of the box. As such the PixelWindow stuff will focus purely on pixel rendering, and for anything else you want to do, SFML can probably do it.

from pixelwindow.

Related Issues (1)

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.