Coder Social home page Coder Social logo

glen3b / glib Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 9.0 7.82 MB

A simple, general purpose C# library implementing windows forms, XNA, extension methods, and more utility classes.

License: GNU Lesser General Public License v3.0

C# 100.00%

glib's People

Contributors

glen3b avatar peterhusman avatar zerodrequiem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

glib's Issues

Allow SpriteSheet to have unique frame times per frame

Currently, the amount of time designated to spend on a single frame (in a SpriteSheet object) must be uniform across all frames. This enhancement proposes that each frame can have a unique amount of time which is spent on it.

TextureFactory.Clone can be improved

The current implementation of Clone in the TextureFactory class is mostly complete, but has a few shortcomings.

  • Even if the Tag object can be cloned in and of itself, the same reference as the original texture is used
  • The mipmap value is not copied to the new texture
  • Null textures are not cloned properly
  • These shortcomings are not currently documented

Improve Screen update cycle

Currently, the Screen class has two primary Update overloads, which are called in different cases. This should probably be cleaned up by merging them into one overload with a potentially null argument. In fixing this, I would like to maintain support for GameTime-free environments, such as XNA embedded within WinForms.

ProgressBar colors are not properties

Setting FillColor or EmptyColor in the ProgressBar class is not threadsafe, and does not update the private field _textureNeedsCalculation. This means setting those fields does not immediately update the texture.

This can be fixed by changing them to properties.

Glib.Xna.SpriteLib.Sprite checks MouseState for every sprite

The call to Mouse.GetState() transitions to unmanaged code, and is surprisingly expensive. Furthermore, it is unnecessary for most sprites in most games / projects, and on Xbox360 deployment.

Suggestion:Have the MouseState passed into the Sprite.Update(MouseState mouseState) method; if passed in value is null, do not perform mouse related functions. This will allow for a single call [per Update cycle] to Mouse.GetState(), which can be passed into sprites that need it.

Problems with this suggestion:Unfortunately, this is a base class; therefore, altering the Update() function will cause problems for projects relying on this class. Yet, this class is currently unsuitable as a generic sprite; given that Glib is relatively new, it may be worthwhile to make the modification now [and risk breaking some code] rather than leave this bug in.

There is an update in PGCGame project that demonstrates the issue:
GreatMindsRobotics/PGCGame@47f825c

Add RelativeCoordinateManager

Add a class, RelativeCoordinateManager, that allows API users to translate from relative coordinates (0 to 1 on all axes, decimal representing percent) to absolute coordinates on a given Viewport. The class should also offer the capability to automatically relocate IPositionable instances upon viewport size change.

The class should accept a width and height in the constructor, and (in addition to having coordinate translation and positionable tracking and locating methods), should have a method to resize its known screen size, which, in the process, will relocate tracked IPositionable instances.

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.