UPBGE3-Logic-Slider-

I use (UPBGE) to make slider buttons. Encountered some problems.,How can I use logical nodes to display text on the screen. Use logic nodes to display images or videos on the screen.


Uploading: 滑块按钮.blend…

if you use only logic bricks or logic nodes video not support in this methods - only sprites gride animation - this cycle sprites animation - in logic brick use replace mesh in edit object actuator for replace animation material - this maybe use for animation button, screens or sprite animation characters in 2D games, just remember you replace mesh model not material if in game use screen plane and replace mesh to sphere - screen model make transformation in sphere. If you need use video in you game use python script for play video -

import bge
from bge import texture
from bge import logic

cont = logic.getCurrentController()
obj = cont.owner

#the creation of the texture must be done once: save the
#texture object in an attribute of bge.logic module makes it persistent
if not hasattr(logic, 'video'):

    # identify a static texture by name
    matID = texture.materialID(obj, 'IMvideo.png')

    # create a dynamic texture that will replace the static texture
    logic.video = texture.Texture(obj, matID)

    # define a source of image for the texture, here a movie
    movie = logic.expandPath('//trailer_400p.ogg')
    logic.video.source = texture.VideoFFmpeg(movie)
    logic.video.source.scale = True

    # quick off the movie, but it wont play in the background
    logic.video.source.play()

#you need to call this function every frame to ensure update of the texture.
logic.video.refresh(True)

this basic video script - but video playing in game use more resurs game engine

感谢你的回复,同时感谢upbge让我无需学习代码.

can you please upload your blend for slider logic? im trying to do this few days without any good result. thanks!

You look at the video below and hope you can perfect it

What video - you mean the video above?

滑块.blend (1.1 MB)

Dragging objects, can’t keep up with the speed of the mouse movement, can you tell me the answer?

After looking at your blend.


I would recommend an operation that forces your Slider object to follow the Mouse Cursorif it is initially hovering over the Slider AND the Left Mouse button is being held down. Make it also if the Left Mouse is released, to make the Slider object no longer follow the Mouse Cursor.
Unfortunately I do not have a revised blend for you - because I am logic-nodes noob.

I would have the mouse curse always invisible, and have a sprite that stands in for the mouse, that you manipulate yourself,