Git Product home page Git Product logo

delvetown's People

Contributors

bennicholls avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

delvetown's Issues

ui.List multiline element renders outside of list container

Dear Future Ben,

ui.List renders all elements inside the list (currently just instances of ui.Textbox but there's no reason they couldn't be other things) that are even partially visible inside the list's designated area. This means that at the top and bottom of the list, multi-line elements that should only be partially be visible render all their lines, spilling over the edge.

To fix: need to think of some way of partially rendering a textbox, and call it here:

Delvetown/ui/list.go

Lines 167 to 177 in 56c54e4

} else {
for _, e := range l.Elements {
_, y, _ := e.GetPos()
_, h := e.GetDims()
if y < l.scrollOffset + l.height && y + h > l.scrollOffset {
e.Render(l.x+offX, l.y+offY-l.scrollOffset, l.z+offZ)
}
}
if l.Highlight {

This is where it decides whether an element is visible. Not hard to filter out partially visible ones and invoke the special ui.Textbox.RenderPartial() or whatever.

Sincerely,

Lazy Past Ben

PS. Sorry for not doing this properly when I fanagled all this together in the first place. I would have done it but I was making a space ship game and wanted to get to the fun part.

GameLog does not use ui.List

This is an easy one. There's still archaic horrible word wrapping code in dm_log when all of that stuff is already implemented nicely(ish) in ui.List.

UI Event Stream Thing Not Being Used

Dear Future Ben,

Delvemode, and all the other modes, should really start using the ui event stream setup that you set up for modes.chargenmode. All modes should be, as much as possible, emitting UI events on input and consuming them in mode.Update(), instead of the weird monstrosity you have going on in delvemode.

I know it doesn't seem like it's worth the effort now, but it probably will be good once things really start getting crazy (like when mouse support is added).

Sincerely,

Past Ben

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.