Skip to content

Fancy rendering of printouts - #553

Open
SquidDev wants to merge 3 commits into
dan200:masterfrom
SquidDev-CC:feature/fancy-printout
Open

Fancy rendering of printouts#553
SquidDev wants to merge 3 commits into
dan200:masterfrom
SquidDev-CC:feature/fancy-printout

Conversation

@SquidDev

@SquidDevSquidDev commented Jun 18, 2018

Copy link
Copy Markdown
Contributor

This renders the contents of printed pages directly when holding them in your hand or displaying them in an item frame. Please note that this implementation isn't currently super optimal as we end up constructing TextBuffers every frame. I would like to get some feedback on a couple of things before going there.

Some things to discuss

  • Item frame interaction is a little funky, as a lot of the behaviour is hard-coded for maps. The key problems are:

    • Rotating will use multiples of 45⁰ for angles (instead of map's 90), meaning it will stick out the side. We could invert the rotation and then apply our own in the event handler, but it's a little ugly.
    • We use the default item frame background instead of a solid one. I don't think this is too much of an issue as it's not normally visible (aside from on the edges), but is problematic when the map is rotated.

    While it would be possible to PR some extensions item frame rendering extensions into Forge for this, I'd rather discuss things here first.

Screenshots

Printout in handPrintout as map

Originally suggested in cc-tweaked/CC-Tweaked#39.

 - When held in first-person, single pages are displayed like a map.
- When placed in an item frame, the page is drawn instead of the actual
item.
 - The current page is always centred when rendering in a GUI, with
the turned pages moving from the sides.
- Pages are no longer evenly distributed from the centre - they follow
an exponential decay curve, so ones further out are closer together
(a bit like an open book).
- Render pages and books in item frames/in-hand (rather than just
single pages).
This currently does some very dirty things with z values in order to
prevent z-fighting. It would be nice to avoid that, though turning off
writing to the z buffer causes issues with the bounding box.
@SquidDev
SquidDevforce-pushed the feature/fancy-printout branch from bff730d to 50797bbCompareJuly 6, 2018 23:06
ccserver pushed a commit to ccserver/ComputerCraft that referenced this pull request Sep 16, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@SquidDev