M
M
Michael Someone2020-10-03 19:26:31
HTML
Michael Someone, 2020-10-03 19:26:31

How do I make the text in the game, and include .json (to be used from a file). And also make use of "islineending"."LyricDuration"?

5f78a616b61fd139117492.png

Hello. Help me to do like this
And connect to var lyrics .json

I have a script like this :

if(songg == 1){
      var audio = new Audio();
audio.src = "(Это типа аудио, ссылке в игре есть)";
audio.play()
var lirycs = [  
{
    "time": 31610,
    "duration": 230,
    "text": "Bié zà ",
    "isLineEnding": 1
  },
  {
    "time": 35302,
    "duration": 230,
    "text": "Yī",
    "isLineEnding": 1
  },
  }];
var next_text = lirycs.shift();
var checker = setInterval(function(){
    if(next_text.time<audio.currentTime*900){

  document.getElementById('lyrics').innerHTML = next_text.text ;


        next_text = lirycs.shift();
    }
    if(audio.ended)clearInterval(checker);
}); 
}
}
И еще "LyricDuration":"-1000(1000)"

To make this work too

Help me make it so that when the time reaches where "lyrics" "islineending":0
Then the lyrics should go to a new line. Like from the beginning of the first word. For when I set it like that, it doesn’t work for me like that, but it remains as it was

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question