Git Product home page Git Product logo

Comments (4)

justinstenning avatar justinstenning commented on September 23, 2024

Take a look at the code within FramesPerSecond class, it uses a font
rendering class that I've included in that project under
Capture\Hook\Common\TextElement.cs is passed to Hook\DX11\OverlayEngine.cs
which in turn uses the DXFont.cs and DXSprite.cs classes to render the text.

So you can simply do something like:

new Capture.Hook.Common.TextElement(new System.Drawing.Font("Arial",
16)) {Text="The
Text to display",
Location = new System.Drawing.Point(5,5), Color =
System.Drawing.Color.Red, AntiAliased = true }

Note the use of Text=".....".

Cheers,
J

On Fri, May 1, 2015 at 8:41 PM, Csharper1972 [email protected]
wrote:

For example this line in DXHookD3D11.cs write on the screen the fps(frames
per second).

new Capture.Hook.Common.FramesPerSecond(new System.Drawing.Font("Arial",
16)) { Location = new System.Drawing.Point(5,5), Color =
System.Drawing.Color.Red, AntiAliased = true }

Now let's say i want to write on screen something else for example the
words "Hello World" on location instead 5,5 but 5,30

How can i do it ? So when i'm running the game a Directx 11 game i will
see the frapes per second and under it i will see the text "Hello World"

I tried to read about how making a Font in directx11 . For example i
searched in google and found about DirectWrite:
http://sharpdx.org/documentation/api/n-sharpdx-directwrite
But i didn't understand how to use it since in the Capture project the
SharpDX dosen't have the namespace DirectWrite.

Maybe you know and can show me how to add more text on screen ? Like it
show the frames per second on screen so show other texts.

I found how to do it in DXHookD3D9.cs but in the DXHookD3D11.cs it's hard
i couldn't find how to dit yet.

β€”
Reply to this email directly or view it on GitHub
#25.

from direct3dhook.

Csharper1972 avatar Csharper1972 commented on September 23, 2024

Ok it's working but not as i wanted i mean i see the text but what i did is added this line: new Capture.Hook.Common.TextElement(new System.Drawing.Font("Arial",16))
{Text=FramesPerSecond.RunTime.ToString(), Location = new System.Drawing.Point(5,30), Color =
System.Drawing.Color.Red, AntiAliased = true }

And you can see i did: Text=FramesPerSecond.RunTime.ToString() and in the FramesPerSecond class(Not the Capture.Hook.Common.FramesPerSecond) i added this part:

static DateTime _startTime = DateTime.Now;

    public static TimeSpan RunTime
    {
        get
        {
            return DateTime.Now - _startTime;
        }
    }

This is working fine in the DXHookD3D9.cs it's showing a clock showing me in real time how much time i'm playing. But in the DXHookD3D11.cs the line with the Text= it's just showing still text of the clock.

What should i do that it will show the clock running ?

from direct3dhook.

Csharper1972 avatar Csharper1972 commented on September 23, 2024

I mean that the line that display the fps i see on the game screen the fps change in real time live.
But the line with the Text = "text to display" when i'm doing
Text = FramesPerSecond.RunTime.ToString() i need to make Atl+Tab all the time to go to the windows and back to the game window then the value of the Text change. But i want that the Text will change in real time live on screen just like the fps.

from direct3dhook.

justinstenning avatar justinstenning commented on September 23, 2024

Probably need to add to diff spot, checkout how the frames per second is
added to the overlay engine in dx11

On Saturday, 2 May 2015, Csharper1972 [email protected] wrote:

I mean that the line that display the fps i see on the game screen the fps
change in real time live.
But the line with the Text = "text to display" when i'm doing

Text = FramesPerSecond.RunTime.ToString() i need to make Atl+Tab all the
time to go to the windows and back to the game window then the value of the
Text change. But i want that the Text will change in real time live on
screen just like the fps.

β€”
Reply to this email directly or view it on GitHub
#25 (comment)
.

from direct3dhook.

Related Issues (20)

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.